Professional Documents
Culture Documents
Rangel and Martha 2019 - Computer Applications in Engineering Education
Rangel and Martha 2019 - Computer Applications in Engineering Education
DOI: 10.1002/cae.22097
| Accepted: 18 November 2018
RESEARCH ARTICLE
KEYWORDS
educational software, MATLAB program, matrix structural analysis, object-oriented-programming
Janeiro (PUC-Rio) and at the Institute of Technical- organization and relationships of the OOP classes of LESM,
Scientific Software Development of PUC-Rio (Tecgraf/ and justify the advantages of the OOP approach in a structural
PUC-Rio). It performs linear-elastic analysis of two and analysis program. The fourth section brings the main concepts
three-dimensional linear element models, such as frames, involved in the idealization of linear elements behavior. The
trusses, and grillages, using the direct stiffness method. The fifth section shows how objects relate to perform the
two most common theories for the idealization of bending structural analysis according to the steps of the direct
behavior of beam elements are considered: Euler-Bernoulli stiffness method. The sixth section demonstrates the use of
and Timoshenko. The program was designed as a the program and the benefits of adopting the OOP paradigm.
complementary tool for undergraduate and graduate The seventh section describes the educational methodology
structural analysis courses at PUC-Rio, focusing on the adopted in relation to working in the source code level and
development of simple and didactic algorithms to perform gives some feedback from student experience. Finally, the last
each step of the analysis. section gives some concluding remarks and points to future
Some features of the LESM program that provide students developments.
an efficient way to learn and practice aspects of computational
implementation on structural analysis are:
2 | ANALYSIS MODELS
MATLAB programming language: The development of This section describes the types of analysis models handled by
programs in MATLAB is done in a high-level program- LESM. These analysis models are frequently adopted as
ming language with an extensive library of predefined analytical abstractions of the behavior of structural systems.
functions, making it easy to understand even for those who In this work, members of any type of analysis model are
are not familiar with any programming language. Oper- generically referred to as elements.
ations and manipulation of matrices and vectors, which is Two coordinate systems are used to locate points and
very frequent in a structural analysis programs, can be define directions in space. Both of them are Cartesian,
executed with simple commands [8]. orthogonal, and right-handed systems. Every structural
Object-Oriented Programming (OOP): This programming model is disposed in an absolute coordinate system called
paradigm is based on the idea of classes, data abstraction, global system (XYZ), and each of its elements has its own
encapsulation, polymorphism, and inheritance [6,9,24]. coordinate system called local system (xyz). Two-
These features are great facilitators for understanding dimensional models are always considered laid in the
the code structure and has proven to be very beneficial global XY-plane.
to the development and maintenance of flexible
and extendable engineering programs as shown
by [2,11,12,18,20,23,25,26,34]. 2.1 | Truss analysis model
Documentation: A well-documented code is the key to make Truss elements are bars connected by frictionless pins
it easier to understand, maintain, modify, and extend. The (hinges), as shown in Figure 1. Therefore, a truss element
source code of LESM is fully commented with detailed does not present any bending or torsion moment induced by
explanations of each file and function. In addition, it is rotation continuity at nodes.
represented by the UML pattern, whose diagrams graphi- A truss model is loaded only at nodes. Any load action
cally show different aspects of the program design [7]. along an element is statically transferred as concentrated
Available source code and documentation: The MATLAB forces to the element ends.
script codes of all classes and methods of LESM, There is only one type of internal force in a truss element:
including its documentation, are available in its site 1; axial force.
see Published Files2 and Methods Diagram3. In Each node of a truss model has only translational degrees-
addition, a link to the URL address of each method of-freedom (DOF): displacements in X and Y-axis
is provided. directions for 2D models and X, Y, and Z-axis directions
for 3D models.
The second section of this paper describes the consider-
ations of the different analysis models supported by the
LESM program. The third section aims to present the
2.2 | Frame analysis model
Frame elements may be rigidly connected at nodes, or have
1
https://web.tecgraf.puc-rio.br/lesm a hinge at one or both ends (see Figure 2).
2
https://web.tecgraf.puc-rio.br/lesm/v1/publish/main.html It is assumed that a hinge in a 2D frame element releases
3
https://web.tecgraf.puc-rio.br/lesm/v1/methods/MethodsDiagram.pdf rotation continuity about Z-axis direction, while a hinge in
RANGEL AND MARTHA
| 3
a 3D frame element releases rotation continuity in all Each node of a 3D frame model has six DOF: displace-
directions. ments in X, Y, and Z-axis directions, and rotations about X,
Internal forces of a 2D frame element are axial force (in x- Y, and Z-axis directions.
axis direction), shear force (in y-axis direction), and
bending moment (about z-axis direction).
Internal forces of a 3D frame element are axial force (in x- 2.3 | Grillage analysis model
axis direction), shear forces (in y-axis and z-axis
directions), bending moments (about y-axis and z-axis Beam elements are laid out in a grid pattern in the XY-plane,
directions), and torsion moment (about x-axis direction). rigidly connected at nodes, or with a hinge at one or both
Each node of a 2D frame model has three DOF: ends (see Figure 3).
displacements in X and Y-axis directions, and rotation It is assumed that a hinge in a grillage element releases
about Z-axis direction. continuity of both flexural and torsion rotations.
4
| RANGEL AND MARTHA
By assumption, there is only out-of-plane behavior, which and replaced. In this case, the program is a collection of
includes displacements transversal to the grillage plane, distinct objects that relate to perform some type of activity.
and rotations about in-plane axes. For further insight on the OOP paradigm concepts, the reader
Internal forces of a grillage element are shear force (in z- is referred to Refs. [6,9,24], and Refs. [7,15] for information
axis direction), bending moment (about y-axis direction) about the UML pattern, which is used to graphically illustrate
and torsion moment (about x-axis direction). the structure of an object-oriented code.
Each node of a grillage model has three DOF: displacement
in Z-axis direction, and rotations about X and Y-axis
3.1 | The OOP classes of the LESM program
directions.
The classes adopted in a program of linear-elastic analysis of
linear elements structures arise naturally. It is intuitive that the
3 | OBJECT ORIENTED problem demands the definition of classes associated with
PROGRAMMING CLASSES linear elements, nodes, materials, cross-sections, etc. How-
ever, the definition of some classes is not so obvious, such as a
The development of computer programs with the OOP class for handling specific aspects of different analysis
approach consists in the construction of independent models. The classes implemented in the LESM program to
modules, called objects, which can be easily reused, modified perform the structural analysis (not including subclasses) are
RANGEL AND MARTHA
| 5
described below and illustrated in Figure 4, following the Material18: This class defines material objects. All
UML standard of software modeling. materials are considered to have linear-elastic behavior,
with homogeneous and isotropic properties.
Drv4 (Driver): This class defines an object that drives the Section19 (Cross-Section): This class defines cross-section
structural analysis. The main global variables of a typical objects of a generic type, which means that particular
structural analysis program are properties of the Drv class. shapes are not specified; only their geometric properties are
Its methods consist of general analysis steps that do not provided.
depend on the analysis model or element type.
Anm5 (Analysis Model): This is an abstract superclass that As a matter of didactics, it was opted for a relaxation in the
declares abstract methods that define the generic behavior fidelity to data encapsulation in the implementation of LESM.
of all types of analysis models. These methods are Accessing the properties of an object through formal methods
implemented in the subclasses that deal with specific makes the code a little less clear and succinct than when direct
types of analysis: Anm_Truss2D6, Anm_Truss3D7, Anm_- access is allowed. Because of that, all properties are public.
Grillage8, Anm_Frame2D9, and Anm_Frame3D10. In the sequel of this work, a method of the LESM program
Elem11 (Element): This is an abstract superclass that is generally referenced by a tag name of the type Superclass.
generically specifies a three-dimensional linear element method.
object. This superclass implements methods related to the
generic mechanical behavior of linear elements (methods for
3.2 | The relationships between classes
axial and torsional behavior), and declares abstract methods to
deal with specific flexural behaviors, which are implemented During the analysis process, only one object of the Drv and
in the subclasses Elem_Navier12 and Elem_Timoshenko13. Anm classes is created. Meanwhile, multiple objects of the
Lelem14 (Load Element): This is an abstract superclass that Elem, Lelem, Node, Material, and Section classes can be
generically specifies an object that represents element created depending on the number of entities related to these
internal loads (distributed loads and temperature varia- classes the model has.
tions). Load values and directions are properties of this The object of the Drv class can be interpreted as an object
class, while activities related to the element behavior that represents the structural model as a whole. Therefore, this
subjected to load actions are methods of this class. This object needs to store all model information in its properties. It
superclass implements methods related to the generic axial must have a handle to the object of the Anm class as well as
behavior, and declares abstract methods related to vectors of handles to the objects of all elements, nodes,
particular flexural behaviors of elements subjected to materials, and cross-sections.
internal loads, which are implemented in the subclasses An element in turn needs to have access to the material and
Lelem_Navier15 and Lelem_Timoshenko16. cross-section that composes it, and to the two nodes that define
Node17: This class defines node objects. A node is a joint its beginning and its end. It is also necessary for an element to
between two or more elements, or any element end, used to check which analysis model it belongs. In addition, there is a
discretize the model. It is always considered as a three- mutual relation between an object of the Elem class and an object
dimensional entity. of the Lelem class, since each element has its own load properties
and each load object must be associated to an element.
A graphical way of representing these relationships between
4
https://web.tecgraf.puc-rio.br/lesm/v1/publish/drv.html classes is through the class diagram of the UML modeling
5
https://web.tecgraf.puc-rio.br/lesm/v1/publish/anm.html language, presented in Figure 5 for the LESM program.
6
https://web.tecgraf.puc-rio.br/lesm/v1/publish/anm_truss2d.html
7
https://web.tecgraf.puc-rio.br/lesm/v1/publish/anm_truss3d.html 4 | IDEALIZATION OF LINEAR
8
https://web.tecgraf.puc-rio.br/lesm/v1/publish/anm_grillage.html ELEMENTS BEHAVIOR
9
https://web.tecgraf.puc-rio.br/lesm/v1/publish/anm_frame2d.html
10
https://web.tecgraf.puc-rio.br/lesm/v1/publish/anm_frame3d.html In the current work, linear-elastic analysis of prismatic elements
11
https://web.tecgraf.puc-rio.br/lesm/v1/publish/elem.html (constant cross-section) is assumed. As a consequence, axial,
12
https://web.tecgraf.puc-rio.br/lesm/v1/publish/elem_navier.html flexural, and torsional behaviors of elements are uncoupled, so
13
https://web.tecgraf.puc-rio.br/lesm/v1/publish/elem_timoshenko.html
14
https://web.tecgraf.puc-rio.br/lesm/v1/publish/lelem.html
15
https://web.tecgraf.puc-rio.br/lesm/v1/publish/lelem_navier.html
16 18
https://web.tecgraf.puc-rio.br/lesm/v1/publish/lelem_timoshenko.html https://web.tecgraf.puc-rio.br/lesm/v1/publish/material.html
17 19
https://web.tecgraf.puc-rio.br/lesm/v1/publish/node.html https://web.tecgraf.puc-rio.br/lesm/v1/publish/section.html
6
| RANGEL AND MARTHA
EI 1
they can be considered separately and overlapping, resulting in Ω¼ ⋅ ð1Þ
GAS l2
the same responses as when acting together.
For frame and grillage models, two bending behavior This parameter multiplies exclusive expression terms of
theories are considered: Euler-Bernoulli theory (also known Timoshenko's theory. When Euler-Bernoulli theory is
as Navier beam) [4,13] and Timoshenko's theory [27,28,31]. adopted, shear deformation is neglected and the shear rigidity
These theories are equivalent for the axial and torsional is assumed infinity. This assumption leads to a null value of
behaviors. Therefore, in truss models, these two theories may the Timoshenko's parameter [31] and unitary values of the
be used indistinguishably, since there is only axial behavior in auxiliary parameters. The results are the classical expressions
a truss element. Figure 6 summarizes the formulations of both of Euler-Bernoulli beam theory. Therefore, the same
flexural behavior theories. expressions could be used for both bending theories. In spite
The mathematical expressions necessary for the implemen- of this, distinct classes were adopted to emphasize symmetry
tation of a matrix analysis program of linear element models, between the expressions from both theories.
considering the uncoupled deformation behavior of elements, The aforementioned mathematical expressions will be
are shape functions, fixed-end-forces, and stiffness coefficients. briefly discussed in the following subsections, and their
All of these expressions related to axial and torsional behaviors expressions are given in the LESM source code, as well as the
are independent of the flexural behavior theory adopted. For the auxiliary parameters for bending behavior.
flexural behavior, generic expressions are derived by introduc-
ing auxiliary parameters, following the developments of
Ref. [27], that unifies the two bending theories. These
4.1 | Shape functions
parameters are based on the Timoshenko's dimensionless Shape functions are used in a displacement-based matrix
parameter that relates bending rigidity with shear rigidity, analysis of linear elements to interpolate the solution of a
presented in Figure 6 and reproduced in Equation 1. continuous field along an element between the discrete values
RANGEL AND MARTHA
| 7
at its nodes. These functions are the analytical homogeneous The expressions for axial displacement shape functions are
solution of the differential equations that governs the implemented in method Elem.axialDisplShapeFcnVector20. The
uncoupled behaviors of an element when unitary field values implementation of transversal displacement shape functions for
are assumed as essential boundary conditions. The shape both xy and xz planes are given in methods Elem.
functions with suitable boundary conditions for axial
displacement and transversal displacement in xy-plane are 20
https://web.tecgraf.puc-rio.br/lesm/v1/methods/Methods%20Elem/
graphically illustrated in Figures 7 and 8, respectively. axialDisplShapeFcnVector.html
8
| RANGEL AND MARTHA
flexuralDisplShapeFcnVector_XY21 and Elem.flexuralDisplSha- The physical interpretation of FEF for axial and flexural
peFcnVector_XZ22 of subclasses Elem_Navier and behaviors are illustrated in Figures 9 and 10, respectively.
Elem_Timoshenko. There is no torsional FEF because distributed torsional
moment is not a load type considered by the LESM program.
4.2 | Fixed-end-forces The axial FEF expressions are implemented in method
The external solicitations distributed over an element are Lelem.axialDistribLoadFEF23, considering only the effect of a
transferred to its ends as equivalent nodal loads (ENL), which linearly distributed load, and method Lelem.axialThermal-
must be energetically consistent to produce the same virtual work LoadFEF24 considering only the effect of temperature
over node displacements as the external solicitation produces variation. The flexural FEF expressions considering only the
over the element displacement field. In the case of linear elements effect of a linearly distributed load are implemented in methods
with uniform cross-section, ENL have the connotation of fixed- Lelem.flexuralDistribLoadFEF_XY25 and Lelem.flexuralDis-
end-force (FEF) support reactions with opposite directions [10]. tribLoadFEF_XZ26 of subclasses Lelem_Navier and Lelem_-
The determination of the FEF of a prismatic element with Timoshenko. The flexural FEF expressions considering only
both ends rigidly connected, subjected to a generic trapezoi- the effect of temperature variation are implemented in methods
dal load covering its entire length, is based on the Betti's Lelem.flexuralThermalLoadFEF_XY27 and Lelem.flexuralTh-
theorem [32], following a procedure described by Ref. [10]. ermalLoadFEF_XZ28 of the same subclasses.
The result of this procedure is a generic integral expression to
calculate all components of FEF caused by distributed loads.
23
Based on the principle of virtual displacements (PVD), a https://web.tecgraf.puc-rio.br/lesm/v1/methods/Methods%20Lelem/
similar generic expression is obtained to calculate the FEF axialDistribLoadFEF.html
24
resulting from the effects of temperature variations on https://web.tecgraf.puc-rio.br/lesm/v1/methods/Methods%20Lelem/
axialThermalLoadFEF.html
elements [22]. To consider an element with a rotation release
25
at one or both ends (hinged connections), straightforward https://web.tecgraf.puc-rio.br/lesm/v1/methods/Methods%20Lelem/
flexuralDistribLoadFEF_XY.html
static condensation procedures should be used [22].
26
https://web.tecgraf.puc-rio.br/lesm/v1/methods/Methods%20Lelem/
flexuralDistribLoadFEF_XZ.html
21 27
https://web.tecgraf.puc-rio.br/lesm/v1/methods/Methods%20Elem/ https://web.tecgraf.puc-rio.br/lesm/v1/methods/Methods%20Lelem/
flexuralDisplShapeFcnVector_XY.html flexuralThermalLoadFEF_XY.html
22 28
https://web.tecgraf.puc-rio.br/lesm/v1/methods/Methods%20Elem/ https://web.tecgraf.puc-rio.br/lesm/v1/methods/Methods%20Lelem/
flexuralDisplShapeFcnVector_XZ.html flexuralThermalLoadFEF_XZ.html
RANGEL AND MARTHA
| 9
FIGURE 9 Fixed-end-forces for linearly distributed axial load and uniform temperature variation
FIGURE 10 Fixed-end-forces for linearly distributed transversal load and uniform transversal temperature gradient
4.3 | Stiffness coefficients kij → Force or moment in the direction of DOF i necessary
to maintain an isolated element in equilibrium when a unitary
The linear relationship between the forces and moments displacement or rotation is imposed in the direction of DOF j.
acting on the element ends with its nodal displacements and The physical interpretation of axial and flexural (in local xy-
rotations is expressed by a stiffness matrix, which is plane) stiffness coefficients are illustrated in Figures 11 and 12,
assembled by stiffness coefficients formally defined as: respectively, where a unitary displacement or rotation is imposed
10
| RANGEL AND MARTHA
at each element end. An analogous interpretation might be given analysis model of each element to assemble its shape function
for flexural stiffness coefficients in xz-plane. Similarly, torsional matrix, FEF vector in local system, and stiffness matrix in
stiffness coefficients correspond to the resulting moments from a local system. These assemblies are made using specific terms
unitary torsional rotation imposed at each element end. handled by the current analysis model.
The implementation of axial and torsional stiffness In the LESM program, these steps are performed by the
coefficients matrices is given respectively in methods Elem. methods Anm.displShapeFcnMtx33 (assembly of shape
axialStiffCoeff29 and Elem.torsionStiffCoeff30. The flexural function matrix), Anm.elemLocDistribLoadFEF34, and
stiffness coefficients are implemented in methods Elem. Anm.elemLocThermalLoadFEF35 (assembly of FEF vector
flexuralStiffCoeff_XY31 and Elem.flexuralStiffCoeff_XZ32 of for distributed load and temperature variation), and Anm.
subclasses Elem_Navier and Elem_Timoshenko. elemLocStiffMtx36 (assembly of stiffness matrix), of the
corresponding analysis model subclass.
Equations 2, 3, and 4 exemplifies the assembly of the
3.4 | Element behavior for specific analysis models
mentioned arrays for a generic 3D frame element. The
All elements are treated as three-dimensional entities, and the analysis model of a 3D frame element is the most general
flexural behavior is always specified in the two principal case because it makes use of all behavior types (axial,
planes of inertia of the element cross-section. It is up to the torsional, and flexural effects in two planes).
2 3
N u1 ðxÞ 0 0 0 0 0 N u2 ðxÞ 0 0 0 0 0
6 7
½N ¼ 4 0 N v1 ðxÞ 0 0 0 N v2 ðxÞ 0 N v3 ðxÞ 0 0 0 N v4 ðxÞ 5 ð2Þ
0 0 N w1 ðxÞ 0 N w2 ðxÞ 0 0 0 N w3 ðxÞ 0 N w4 ðxÞ 0
T
ff elg ¼ f ea1 f ef xy
1 f ef xz
1 0 f ef xz
2 f ef xy
2 f ea2 f ef xy
3 f ef xz
3 0 f ef xz
4 f ef xy
4 ð3Þ
2 3
kea11 0 0 0 0 0 kea12 0 0 0 0 0
6 0 kef xy kef xy kef xy kef xy 7
6 11 0 0 0 12 0 13 0 0 0 14 7
6 7
6 0 0 kef xz 0 kef xz 0 0 0 kef xz 0 kef xz 0 7
6 11 12 31 14 7
6 7
6 0 0 0 ket11 0 0 0 0 0 ket12 0 0 7
6 7
6 0 kef xz kef xz kef xz kef xz 0 7
6 0 0 0 0 0 0 7
6 21 22 23 24
7
6 0 kef xy 0 0 0 kef xy 0 kef xy 0 0 0 xy 7
kef 24 7
6 21 22 23
½kel ¼ 6 7 ð4Þ
6 kea21 0 0 0 0 0 kea22 0 0 0 0 0 7
6 7
6 7
6 0 kef xy 0 0 0 kef xy 0 kef xy 0 0 0 kef xy
34 7
6 31 32 33
7
6 0 kef xz kef xz kef xz kef xz 0 7
6 0 31 0 32 0 0 0 33 0 34 7
6 7
6 0 0 0 ket21 0 0 0 0 0 ket22 0 0 7
6 7
6 7
4 0 0 kef xz
41 0 kef xz
42 0 0 0 kef xz
43 0 kef xz
44 0 5
0 kef xy
41 0 0 0 kef xy
42 0 kef xy
43 0 0 0 kef xy
44
29 33
https://web.tecgraf.puc-rio.br/lesm/v1/methods/Methods%20Elem/ https://web.tecgraf.puc-rio.br/lesm/v1/methods/Methods%20Anm/
axialStiffCoeff.html displShapeFcnMtx.html
30 34
https://web.tecgraf.puc-rio.br/lesm/v1/methods/Methods%20Elem/ https://web.tecgraf.puc-rio.br/lesm/v1/methods/Methods%20Anm/
torsionStiffCoeff.html elemLocDistribLoadFEF.html
31 35
https://web.tecgraf.puc-rio.br/lesm/v1/methods/Methods%20Elem/flexur- https://web.tecgraf.puc-rio.br/lesm/v1/methods/Methods%20Anm/
alStiffCoeff_XY.html elemLocThermalLoadFEF.html
32 36
https://web.tecgraf.puc-rio.br/lesm/v1/methods/Methods%20Elem/ https://web.tecgraf.puc-rio.br/lesm/v1/methods/Methods%20Anm/
flexuralStiffCoeff_XZ.html elemLocStiffMtx.html
RANGEL AND MARTHA
| 11
forces or moments) with ENL (element FEF with opposite 5.5 | Computation of internal forces
directions) resulting from distributed loads or temperature
Internal forces of elements are computed at its ends
variations on elements. The applied nodal loads are directly
considering the effects of global and local analysis. The
inserted into the corresponding position of the global forcing
effects of global analysis come from the results of nodal
vector in the Anm.nodalLoad47 method.
displacements and rotations of the system of equilibrium
For each element, the Drv.elemLoads48 method calls the
equations while the local fixed-end effects come from
Lelem.gblDistribLoadENL49 and the Lelem.gblThermalLoa-
distributed loads or temperature variations on elements.
dENL50 methods (see diagram of Figure 15). These methods
The internal forces from local analysis are the FEF. To
return the element ENL vectors in global system for
compute element internal forces from global analysis, its nodal
distributed load and temperature variation, respectively.
displacements, fdegg, is extracted from the global displace-
This is done by calling the Anm.elemLocDistribLoadFEF51
ment vector and rotated to the local system, fdelg. The
method and/or the Anm.elemLocThermalLoadFEF52 method,
displacement vector in the local system is then multiplied
which provide the FEF vector in local system according to the
by the element stiffness matrix, ½kel, resulting in internal
current analysis model, and then applying a rotation
forces acting in the directions of the element local DOF:
transformation and inverting its direction. The coefficients
of the ENL vectors are inserted to the correct positions of the ff elg ¼ ½kel½Rfdegg ¼ ½kelfdelg ð8Þ
global forcing vector in the Drv.assembleENL53 method.
The computation of internal forces is performed by the
Drv.elemIntForce55 method, as shown in the sequence
5.4 | Solving the system of equations
diagram of Figure 16. In each iteration of a loop over all
The system of equilibrium equations is solved in the Drv. elements, the Anm.initIntForce56 method is called to initialize
solveEqnSystem54 method (indicated in Figure 15). The free the vectors of internal forces with null values. The results
nodal displacements and rotations are obtained by the solution from global analysis is returned from the Elem.gblAnlInt-
of the first row of Equation 5, as follows: Force57 method. This method computes the internal forces at
the ends of each element based on its nodal displacements and
1
Df ¼ Kf f Ff K f s fDs g ð6Þ rotations. The results from local analysis are previously stored
when local FEF are calculated. The combination of the results
Considering that vector fFs g previously stores combined from global and local analyses are then added to the internal
nodal loads applied directly to constrained DOF, to forces vector in the Anm.assembleIntForce58 method.
compute the support reactions, it is necessary to superim-
pose fFs g to the solution of the second row of Equation 5: 6 | EXAMPLE
fFs g ¼ fFs g þ K sf Df þ ½K ss fDs g ð7Þ
A simple 2D frame model is adopted to demonstrate the use of
the LESM program and the OOP approach. Figure 17 shows a
frame in the XY-plane with three nodes and two elements,
both Navier beams. Node 1 is restricted in the Y-axis
direction, node 3 is restricted in the X and Y-axis directions,
and element 2 has a uniform distributed load of 5 kN/m. The
47
https://web.tecgraf.puc-rio.br/lesm/v1/methods/Methods%20Anm/ input data file read by the program is also presented. It is a text
nodalLoads.html file, with .lsm extension, that stores all the information needed
48
https://web.tecgraf.puc-rio.br/lesm/v1/methods/Methods%20Drv/ for the analysis following the neutral file format described in
elemLoads.html Ref. [14].
49
https://web.tecgraf.puc-rio.br/lesm/v1/methods/Methods%20Lelem/ The developed OOP class organization allows a generic
gblDistribLoadENL.html treatment of the model attributes. All node, element, load, and
50
https://web.tecgraf.puc-rio.br/lesm/v1/methods/Methods%20Lelem/
gblThermalLoadENL.html
51 55
https://web.tecgraf.puc-rio.br/lesm/v1/methods/Methods%20Anm/ https://web.tecgraf.puc-rio.br/lesm/v1/methods/Methods%20Drv/
elemLocDistribLoadFEF.html elemIntForce.html
52 56
https://web.tecgraf.puc-rio.br/lesm/v1/methods/Methods%20Anm/ https://web.tecgraf.puc-rio.br/lesm/v1/methods/Methods%20Anm/
elemLocThermalLoadFEF.html initIntForce.html
53 57
https://web.tecgraf.puc-rio.br/lesm/v1/methods/Methods%20Drv/ https://web.tecgraf.puc-rio.br/lesm/v1/methods/Methods%20Elem/
assembleENL.html gblAnlIntForce.html
54 58
https://web.tecgraf.puc-rio.br/lesm/v1/methods/Methods%20Drv/ https://web.tecgraf.puc-rio.br/lesm/v1/methods/Methods%20Anm/
solveEqnSystem.html assembleIntForce.html
RANGEL AND MARTHA
| 13
cross-section objects are three-dimensional entities, which Thus, the element does not need to adapt to the analysis model,
means that their properties store the values read from all three having its behavior available to any model that requests it. The
dimensions. It is up to an object of the Anm class (in fact, an Anm object is the one that adapts the element to the target
object of a subclass of the Anm superclass) to identify which analysis. Notice that in method Anm.elemLocStiffMtx the call
uncoupled behaviors and DOF must be used for the assembly to method Elem.flexuralStiffCoeff_XY is generic, working for
of the system of equilibrium equations. Navier or Timoshenko elements. This is an example of
For example, the method Anm.elemLocStiffMtx, to polymorphism in the current OOP implementation.
assemble the stiffness matrix of an element in local system, Another example of polymorphism is in the method Elem.
needs to access stiffness coefficients associated with different gblStiffMtx. This method is used to rotate an element stiffness
behaviors of the element in different planes, depending on the matrix from its local system to the global system, as indicated
analysis model. The assembly of this matrix for a 3D frame below. The call to method Anm.elemLocStiffMtx is also
was presented in Equation 4. For the given 2D frame, it is generic, and the actual method that is called is the one
necessary to obtain the axial stiffness coefficients and the associated to the target analysis model.
Navier formulation of flexural stiffness coefficients in the xy-
plane, using the Elem.axialStiffCoeff and Elem.flexuralStiff-
Coeff_XY methods, according to the scripts shown in the
sequel:
7 | EDUCATIONAL METHODOLOGY
FIGURE 14 UML sequence diagram of the assembly of the global stiffness matrix
FIGURE 15 UML sequence diagram of the assembly of the global forcing vector
stiffness matrix of a two-dimensional frame member in its local class was very positive. A student made a report that
system and to complete the source code of these methods. summarizes the success of the adopted methodology: “I
Several assignments of these types were proposed during appreciated the methodology used in the structural analysis
a course semester, covering the entire analysis module of course. Through the computational implementation it was
LESM program. Written exams would also cross-evaluate possible to really understand the method of structure analysis
aspects of the direct stiffness method and its implementation. employed. If it had been asked to implement the program
In PUC-Rio all disciplines are evaluated by the students at from a blank page it would have been almost impossible for a
the end of each semester. The feedback provided by the normal civil engineering student to complete it. On the other
students of the two semesters of the present structural analysis hand, the organization of the code provided by the
16
| RANGEL AND MARTHA
Possible future developments include the extension of the ΔT x → uniform temperature variation in the center of
analysis options, such as the consideration of physical and/or gravity of the element cross-section
geometric nonlinearity. When dealing with second-order ΔT y → transversal temperature gradient along the
analyzes, it is necessary to solve numerically a system of element y-axis (ΔT bottom ΔT top )
non-linear equations by an appropriate method. In this case, a ΔT z → transversal temperature gradient along the
class responsible for the implementation of the numerical element z-axis (ΔT bottom ΔT top )
solution algorithms of the system must be included. Therefore, V→ shear force
the class that drives the structural analysis (currently the Drv M→ bending moment
class) would be split into an algorithm class and a class ff elg → element fixed-end-force vector in local system
responsible for the data and general behavior of the model. f eai → element axial fixed-end-force component
f ef xy
i → element flexural fixed-end-force component in
xy-plane
ACKNOWLEDGMENTS
f ef xz
i → element flexural fixed-end-force component in
The authors would like to thank the National Council for xz-plane
Scientific and Technological Development (CNPq), the ½kel → element stiffness matrix in local system
Pontifical Catholic University of Rio de Janeiro (PUC- keaij → element axial stiffness coefficient
Rio), and the PUC-Rio Technical-Scientific Software ketij → element torsional stiffness coefficient
xy
Development Institute (Tecgraf/PUC-Rio) for the financial kef ij → element flexural stiffness coefficient in xy-
support and for providing the necessary space and plane
resources used during the development of this work. The kef xz
ij → element flexural stiffness coefficient in xz-
authors are also grateful to former undergraduate student plane
and intern of Tecgraf/PUC-Rio, Murilo Felix Filho, who u0 → axial displacement of an element point
contributed to the development of the program source v0 → displacement transverse to the element y-axis
code. w0 → displacement transverse to the element z-axis
θ→ cross-section rotation about element z-axis
NOMENCLATURE from bending effect
ϕ→ cross-section rotation about element y-axis
from bending effect
½N → shape function matrix
l→ element length
Ni →
u
axial displacement shape function
E→ material elasticity modulus
N vi → transversal displacement shape function in
G→ material shear modulus
local y-axis (xy-plane)
α→ material thermal expansion coefficient
N wi → transversal displacement shape function in
A→ cross-section area (Ax )
local z-axis (xz-plane)
As → cross-section effective shear area (Ay or Az )
εfx → normal deformation in axial direction from
I→ cross-section moment of inertia (I z or I y )
bending effect
Jt → cross-section torsional moment of inertia (I x )
γs → distortion from shear effect
Ω→ Timoshenko's basic parameter
σfx → normal stress in axial direction from bending
qx → axially distributed load on element
effect
qx0 → uniform component of axially distributed load
τxy → tangential stress from shear effect
qx1 → linear component of axially distributed load
c0 ,c1 ,c2 ,c3 → integration constants
qy → distributed load transverse to the element y-
axis
qy0 → uniform component of distributed load trans- ORCID
verse to the element y-axis
Luiz Fernando Martha http://orcid.org/0000-0002-5783-
qy1 → linear component of distributed load transverse
5151
to the element y-axis
qz → distributed load transverse to the element z-
axis
qz0 → uniform component of distributed load trans- REFERENCES
verse to the element z-axis 1. U. Ahmad (2013) Development of a structural analysis program
qz1 → linear component of distributed load transverse (SABSM) using MATLAB featuring graphical user interface.
to the element z-axis Dissertation, City University of London
18
| RANGEL AND MARTHA
2. G. Archer, G. Fenves, and C. Thewalt, A new object oriented finite 25. R. M. V. Pidaparti and A. V. Hudli, Dynamic analysis of structures
element analysis program architecture. Comput. Struct. 70 (1999), using object-oriented techniques. Comput. Struct. 49 (1993),
63–75 149–156
3. S. Barreto, R. Piazzalunga, and V. Ribeiro, A web-based 2D 26. B. Raphael and C. S. Krishnamoorthy, Automating finite element
structural analysis educational software. Comput. Appl. Eng. development using object-oriented techniques. Eng. Computation
Educ. 11 (2003), 83–92. https://doi.org/10.1002/cae.10040 10 (1993), 267–278.
4. F. P. Beer et al., Mechanics of Materials. McGraw-Hill Education, 27. J. N. Reddy, On locking-free shear deformable beam finite
New York, 2014. elements. Comput. Methods Appl. Mech. Eng. 149 (1997),
5. P. L. Bishay, “FEApps”: Boosting students’ enthusiasm for coding 113–132
and App designing, with a deeper learning experience in 28. J. N. Reddy, C. M. Wang, and K. H. Lee, Relationships between
engineering fundamentals. Comput. Appl. Eng. Educ. 24 (2016), bending solutions of classical and shear deformation beam
456–463. https://doi.org/10.1002/cae.21723 theories. Int. J. Solids Struct. 34 (1997), 3373–3384
6. G. Booch et al., Object-oriented analysis and design with 29. SALT. (http://saltserver.org)
applications. Addison-Wesley, Upper Saddle River, NJ, 2007. 30. Y. Suh, Development of educational software for beam loading
analysis using pen-based user interfaces. J. Comput. Des. Eng. 1
7. G. Booch, J. Rumbaugh, and I. Jacobson, The unified modeling
(2014), 67–77. https://doi.org/10.7315/JCDE. 2014.007
language user guide. Addison-Wesley, Upper Saddle River, NJ, 2005.
31. S. P. Timoshenko and J. M. Gere, Theory of elastic stability. Dover
8. S. Chapman, MATLAB programming for engineers. Cengage
Publications, New York, 2012.
Learning, Boston, 2015.
32. R. N. White, P. Gergely, and R. G. Sexsmith, Structural
9. B. Cox and A. Novobilski, Object-oriented programming: an
Engineering − Combined Edition − Vol. 1: Introduction to Design
evolutionary approach. Addison-Wesley, Upper Saddle River, NJ,
Concepts and Analysis − Vol. 2: Indeterminate Structures. John
1991.
Wiley & Sons, New York, 1976.
10. L. P. Felton and R. B. Nelson, Matrix Structural Analysis, John
33. X. F. Yuan and J. G. Teng, Interactive web-based package for
Wiley & Sons, New York, 1996
computer-aided learning of structural behavior. Comput. Appl.
11. G. Fenves, Object-oriented programming for engineering software
Eng. Educ. 10 (2002), 121–136. https://doi.org/10.1002/cae.10020
development. Eng. Comput. 6 (1990), 1–15
34. T. Zimmermann et al., Object-oriented finite element program-
12. B. W. R. Forde, R. O. Foschi, and S. F. Stiemer, Object-oriented
ming: I. Governing principles. Comput. Methods Appl. Mech. Eng.
finite element analysis. Comput. Struct. 34 (1990), 355–374
98 (1992), 291–303.
13. B. J. Goodno and J. M. Gere, Mechanics of Materials. CL
Engineering, Boston, 2017.
14. https://web.tecgraf.puc-rio.br/neutralfile/ R. L. RANGEL is a master's student in
15. http://www.uml.org/ the Civil Engineering program of the
16. P. Krysl and A. Trivedi, Instructional use of MATLAB software
Pontifical Catholic University of Rio
components for computational structural engineering applications.
de Janeiro (PUC-Rio), Brazil. In his
Int. J. Engng. Ed. 21 (2005), 778–783
17. J. Lee and S. Ahn, Finite element implementation for computer-
thesis, he carries a research on the
aided education of structural mechanics: frame analysis. Comput. implementation of geometrically
Appl. Eng. Educ. 22 (2011), 387–409. https://doi.org/10.1002/ nonlinear structural analysis of fram-
cae.20563 ed models. He received his under-
18. R. I. Mackie, Object-oriented programming of the finite element graduate degree in Civil Engineering from PUC-Rio in
method. Int. J. Numer. Meth. Eng. 35 (1992), 425–436 2016, when he developed the LESM program for struct-
19. L. F. Martha, (1999) Ftool: A structural analysis educational ural analysis of linear elements. He is also member of the
interactive tool. Proceedings of Workshop in Multimedia
Modeling and Visualization in Engineering and Geology
Computer Techniques in Engineering Education, Institute for
(MVGEO) group of the Tecgraf Institute of Technical-
Structural Analysis, Technical University of Graz, Austria, pp.
51–65. Scientific Software Development of PUC-Rio (Tecgraf/
20. L. F. Martha and E. Parente, An object-oriented framework for PUC-Rio).
finite element programming. Proceedings of the Fifth World
Congress on Computational Mechanics, IACM, Vienna, Austria, L. F. MARTHA is an associate profes-
2002. on-line publication (ISBN 3-9501554-0-6), Paper-ID: sor in Civil Engineering at Pontifical
80480, p. 10 Catholic University of Rio de Janeiro
21. MASTAN2 (http://www.mastan2.com) (PUC-Rio), Brazil, and member of the
22. W. McGuire, R. Gallaguer, and R. Ziemian, Matrix Structural Tecgraf Institute of Technical-Scien-
Analysis. John Wiley & Sons, New York, 2000.
tific Software Development of PUC-
23. G. R. Miller, An object-oriented approach to structural analysis
and design. Comput. Struct. 40 (1991), 75–82.
Rio (Tecgraf/PUC-Rio). He got his
24. M. O'Docherty, Object-oriented analysis and design: understand- PhD degree in Structural Engineering
ing system development with UML 2.0. John Wiley & Sons, in 1989 from Cornell University, working in the Cornell
Chichester, West Sussex, England, 2005. Fracture Group and in the Cornell Program of Computer
RANGEL AND MARTHA
| 19