You are on page 1of 35

Pembagian Tugas 8 - Chapter11 - Vol.

1 (Metode Elemen Hingga)


Sampai
No. Nama NPM Dari Hal -
Hal
1 Susilo Widyatmoko 2006493871 383 - 383
2 Dyah Ayu Aurellia Yasmiin 1706027080 384 - 384

TUGAS 8
3 Alfetra Henoch Tandita 1706036021 385 - 385
4 Bias January Parmadi 2006545572 386 - 386
5 Vivin Novi Adryana 2006546373 387 - 387
6 Salfa Zarfatina 1706035845 388 - 388
7 Daniel Alvin Giovanni S. 2006545591 389 - 389
METODE ELEMEN 8
9
Ida Royana Tambunan-
M.Jeva Ikramullah
2006545912
1706035896
390
391
-
-
390
391
HINGGA 10 Annisa Ayu Wulandari 2006545515 392 - 392
11 Asri Puspita Sari Sidabutar 2006545534 393 - 393
2021 12 Agus Mudo Prasetyo 2006545414 394 - 394
13 Imam Nakhrowi 2006545925 395 - 395
14 Sarah Fatihah Nugroho 2006546253 396 - 396
CHAPTER 11 15
16
Vania Callista
Andreas
1706035984
1806202992
397
399
-
-
398
400
17 Imam Taufik Rahmadi 2006545931 401 - 402
18 Syaiful Rachman 2006546303 403 - 404
19 Nur Hafidz Hidayat 2006493650 405 - 406
20 Erriman Manru 2006545673 407 - 1 408
Structural Analysis with the Finite Element Method
by Eugenio Onate

CHAPTER 11

LEARNING TO PROGRAM THE FEM


WITH MATLAB AND GID
2
• As for any other numerical method, the application fo the FEM is linked to the
programming laguage and software tools chosen.
• Historically the first programming language for practical use of the FEM was fortran.
Since then many routines, algorithms and programs associated to the method have
been programmed in this language.
• With the development of computers new language have appeared, each one with
capabilities and specific tools for diverse fields of application. The common objective
is to simplify the coding of the algorithms and to optimize the computer resources.

Hal. 383 | Susilo Widyatmoko (2006493871) 3


• Although FORTRAN continues being a language of reference for the FEM, the new language and
programming tools allow simplifications in the coding work.
• At the same time specific libraries can be used that optimize the memory and computer resources,
This is a key feature of MATLAB that beside being a research tool.
• it allows us to write codes that it can be interpreted at the time of execution.
• MATLAB allows us to make us of all the implemented matrix routines for optimizing the calculations
up to the point to compete efficiently with other compiled languages.
• MATLAB is a software code designed to work with matrices, facilitating the matrix algebra operations
from the numerical and storage point of view, while providing also a simple and easy way to handle
complex routines.

Hal. 383 | Susilo Widyatmoko (2006493871) 4


Hal. 384 | Dyah Ayu Aurellia Yasmiin (1706027080) 5
Hal. 384 | Dyah Ayu Aurellia Yasmiin (1706027080) 6
Hal. 385 | Alfetra Henoch Tandita (1706036021) 7
11.2 MAT-fem

Hal. 386 | Bias January Parmadi (2006545572) 8


11.3 DATA FILES

Hal. 386 | Bias January Parmadi (2006545572) 9


11.3 DATA FILES

Hal. 386 | Bias January Parmadi (2006545572) 10


11.3 DATA FILES

Hal. 386 | Bias January Parmadi (2006545572) 11


Hal. 387 | Vivin Novi Adryana (2006546373) 12
11.3 DATA FILES
1 = the node is fixed
in the x direction
The fixed DOF code 2 = the node is fixed
• The fixnodes matrix defines the DOFs prescribed for the particular in the y direction
problem to be solved. fixnodes is a matrix where the number of rows The DOF
corresponds to the number of prescribed DOFs and the number of columns value
describes in the following order: the prescribed node number, the fixed DOF Node Number
code (1 if the node is fixed in the x direction and 2 if it is fixed in the y
direction) and the prescribed DOF value. In this way if a node is prescribed in
both directions two lines are necessary to define this condition.
• The pointload matrix is used to define nodal point loads. This is a matrix The direction in
which the loads acts
where the number of rows is the number of point loads acting on the
structure and each of the three columns describes the number of the loaded
node, the direction in which the load acts and the magnitude of the load. Number of Magnitude
loaded node of the load
Point loads are defined in the global system of coordinates. If there are no
point loads, pointload is defined as an empty matrix by means of the
command pointload = []; Value of the distributed
load in direction X
• Sideload contains the information for uniformly distributed loads acting on
the element sides. Sideload is a matrix with as many rows as the number of Value of the
loaded element sides. The first two columns define the nodes on the loaded Nodes on distributed
the loaded load in
side and columns three and four list the values of the distributed load by unit direction Y
side
length in directions x and y, respectively. If no uniform loads act sideload is
defined as an empty matrix by means of the command sideload = [];

Hal. 388 | Salfa Zarfatina (1706035845) 13


11.4 START
• MAT-fem begins making all variables equal to zero with the clear command
• Next it asks the user the name of the input data file that he/she will use (the .m extension in not
included in the filename).
• Figure 11.5 shows the first lines of the code corresponding to the variables boot as well as the clock set
up, which stores the total time of execution in ttim

Hal. 389 | Daniel Alvin Giovanni S. (2006545591) 14


11.4 START
• List of command on MAT-fem
• Number of nodal point npnod corresponds to the number of lines in the coordinates matrix.
• The number of total DOFs of the problem, nndof, will be twice the number of nodes (2*npnod).
• nelem is the number of elements and is equal to the number of lines in the elements matrix, whereas the number of nodes for each element nnode is the number
of columns in elements.
• In this way triangular elements are identified if the number of columns in elements is three, whereas the number of columns will be four for quadrilateral elements.
• The total number of equations per element, neleg, is the number of element nodes nnode multiplied by the number of DOFs for each node, i.e. two for 2D problems.
• Inside timing the tic and toc MATLAB commands are used.

11.5 STIFFNESS MATRIX AND EQUIVALENT NODAL


FORCE VECTOR FOR SELF-WEIGHT
11.5.1 Generalities

• The code line shown in Figure 11.6 define the global stiffness matrix and the equivalent
nodal force vector as a sparse matrix and vector.
• As the purpose to demonstrating the implementation of the FEM, some
simplifications are made like using a single material for the whole domain.
• Consequently, the constitutive matrix does not vary between adjacent elements and it is
evaluated before initiating the computation of the element matrix.
• The subroutine constt makes use of the Young modulus, the Poisson's ratio and a flag
that allows us to distinguish between a plane stress and a plane strain problem to form
the constitutive matrix which is stored in dmat.
• Figure 11.7 the subroutine constt shows the explicit form of dmat for an isotropic
linear elastic material.

Hal. 390 | Ida Royana Tambunan (2006545912) 15


11.5 STIFFNESS MATRIX AND EQUIVALENT NODAL FORCE
VECTOR FOR SELF-WEIGHT
11.5.1 Generalities
• Figure 11.8 shows the element loop within which the
stiffness matrix and the equivalent nodal vector for
self-weight are calculated and assembled for each
element.
• Vector lnods stores the nodal connectivities for the
element
• the coord matrix stores the coordinates for these
nodes.
• The subroutines TrStif and QdStif are called for
triangular and quadrilateral elements, respectively
• vector eqnum is defined. It contains the global
equations number for each one of the equations in
the element stiffness matrix.
• The equations assembly process is implemented by
means of two loops from 1 to neleq

Hal. 391 | M.Jeva Ikramullah (1706035896) 16


Hal. 392 | Annisa Ayu Wulandari (2006545515) 17
The TrStif subroutine (called as a function) is defined for
triangular elements as shown in Figure 11.9. Note that
the Cartesian derivatives of the linear shape functions
are calculated directly. These derivatives are constant
over the element. In this way the strain matrix bmat
is built simply by placing each of the Cartesian
derivatives (b(i)/area2 and c(i)/area2) in the adequate
position of the strain matrix (Eq.(4.39)).

Hal. 393 | Asri Puspita Sari (2006545534) 18


Figure 11.10 shows the evaluation of the stiffness matrix for the
• Initially the element shape functions and their natural quadrilateral element which is performed using numerical integration.
derivatives are defined (fform and deriv).
• This definition is made by means of an intrinsic function.
• This facility of MATLAB avoids the use of additional subroutines.
• At this level also the Gauss point coordinate values (pospg)
and their weights (pespg) corresponding to the 2x2 integration
rule are defined.
• Once the variables are initialized two loops define the Gauss
integration process.
• The lcffm vector contains the values of the shape
functions evaluated at the integration point i,j and the
lcder matrix stores the values for the natural derivatives of
the shape functions at each integration point.
• The Jacobian matrix (xcjacm) is evaluated by multiplication of
the lcder matrix by the coordinates of the element nodes.
• The values of the Cartesian derivatives of the shape functions
(ctder) at each integration point are obtained by multiplying
the inverse of the Jacobian matrix by the natural derivatives of
the shape functions computed at the integration point.
• The area differential (darea) is computed as the
determinant of the Jacobian matrix multiplied by the two
weighting functions at the integration point and the element
thickness.

Hal. 394 | Agus Mudo Prasetyo (2006545414) 19


11.5 STIFFNESS MATRIX AND EQUIVALENT NODAL FORCE
VECTOR FOR SELF-WEIGHT
11.5.2 Computation and assembly of K(e) and f (e) (self-weight) for 3-noded triangles and 4-noded quadrilaterals

The strain matrix is obtained by placing the Cartesian Finally the equivalent nodal force components are placed in the F
derivates of the shape functions in the matrix array vector, recalling that only the negative force component along the
bmat. The element stiffness matrix is obtained by y axis exists.
integrating the standard BTDB expression. Numerical The routines shown in Figures 11.9 and 11.10 clearly demonstrate
integration requires evaluating the sum of the product the two alternatives for computing the element stiffness matrix
of BTDB and darea calculated at all the Gauss points. using the explicit form (3-noded triangle) or by means of
This sum is stored in matrix M (Figure 11.10). numerical integration (4-noded quadrilateral).

The equivalent nodal force vector for the self-weight


case requires integrating over the element area the
product of the shape functions and the specific weight
for the element. The vector is stored in the variable fy.

Hal. 395 | Imam Nakhrowi (2006545925) 20


11.6 EXTERNAL LOADS

Besides the self-weight load we consider uniformly


distributed loads acting on the element sides and nodal point
loads.
As both the elements considered have linear shape
functions, the calculation of the nodal contribution for
uniformly distributed side loads is exactly the same for both
cases. The evaluation is made in the main routine of the MAT-
fem program after the assembly of the stiffness matrix.
The code is shown in Figure 11.11 where the loop over
the number of loads defined by sideload can be seen. The
nodal contributions are the same for each node (due the
linear shape functions) and they are stored in the force
variable.

Hal. 395 | Imam Nakhrowi (2006545925) 21


 The loads are defined in the global
coordinate system.
 The calculation steps for nodal
point loads are as simple as adding
the value of the point load acting at
the node to the global equivalent
nodal force vector in the position
corresponding to the adequate
DOF of the loaded node.
 A loop over the number of nodal
point loads is implemented, finding
for each node the equation number
associated to it and adding the
value of the point load to the force
vector (Figure 11.12)

Hal. 396 | Sarah Fatihah Nugroho (2006546253) 22


11.7 PRESCRIBED DISPLACEMENTS

 Figure 11.13 shows the loop over the


prescribed displacement DOFs and how the
values defined by the fixnodes matrix are
assigned to the nodal displacement vector u.
 the fix vector is defined to store the equation
numbers for the prescribed DOFs
 the force vector is updated with the product of
the StifMat matrix and the u vector following
the procedure described in Section 1.10

contains the values of the


prescribed DOFs only

Hal. 396 | Sarah Fatihah Nugroho (2006546253) 23


11.8 SOLUTION OF THE EQUATIONS SYSTEM

• The strategy used is solving equation system


without considering DOFs whose values are
known
• The FreeNodes vector contains the list of
equations to be solved

11.9 NODAL REACTIONS


• Nodal reactions are computed by means of the
expression reaction=StifMat*u-force
• In order to avoid unnecessary calculations we
use vector fix which contains the list of the
equations associated to the prescribed DOFs

Hal. 397-398 | Vania Callista (1706035984) 24


11.10 STRESS
11.10.1 GENERALITIES
• Stresses are evaluated using DBu expression
• The next step is to transfer the values of stresses from
integration points to the element nodes
• Nodal stresses stored in Strnod matrix

11.10.2 COMPUTATION OF THE STRESSES AT THE NODES


• Fig 11.17 presents the initial part of the stress subroutine
were the input data are
• The material consecutive matrix dmat
• The Poisson's ratio poiss
• The flag for the problem type pstrs
• The nodal displacement u
• In order to simplify the reading of the routine some
variables are extracted like
• nelem indicating number of elements
• nnode indicating the number of nodes per element
• npod defining the total number of nodes in the
mesh
Hal. 397-398 | Vania Callista (1706035984) 25
11.10.2 COMPUTATION OF THE STRESSES AT THE NODES (cont)

Hal. 399-400 | Andreas (1806202992) 26


11.10.2 COMPUTATION OF THE STRESSES AT THE NODES (cont)

Hal. 399-400 | Andreas (1806202992) 27


Hal. 401-402 | Imam Taufik Rahmadi (2006545931) 28
Hal. 401-402 | Imam Taufik Rahmadi (2006545931) 29
Hal. 403-404 |Syaiful Rachman (2006546303) 30
Node prescribed Uniformly General properties/
displacement/constraint distributed load problem data Data file writing

Point load Material Create mesh


properties

The first button works to identify the


geometrical elements (point or lines)
that have nodes with prescribed
displacements. When pressing on, an
GiD capabilities: emergent window will appear to
• Geometry generation select the points or lines where the
• Import and handling displacements are prescribed (Figure
• GiD discretization techniques 11.26) The check boxes identify the
prescribed directions. Also it is
Solving a problem in MAT-fem is very simple once possible to assign a non-zero value to
geometry has been defined. Just follow the icons. the constraint.

Visit www.gidhome.com for more information

Hal. 403-404 |Syaiful Rachman (2006546303) 31


 Lanjutan
When selected, an emergent window (Figure 11.27a) allows introducing
the point load value in the global coordinate system. Then it is
necessary to select the nodes were the load is applied. The third button
is associated to uniformly distributed loads along the element sides and
permits to assign this condition on geometry lines. Theemergent
window (Figure 11.27b) allows introducing the value of the side load
per unit length referred to the global coordinate system.

The material properties are de¯ned with the fourth button in Figure
11.25 which leads to the emergent window shown in Figure 11.28a.
This allows defining the material parameters like the Young modulus,
the Poisson’s ratio, the density and the thickness. It is necessary to
assign these properties over the surfaces that de¯ne the domain. As
mention earlier, only one type of material is allowed in MAT-fem for the
sake of simplicity. The general properties button (the ¯fth button in
Figure 11.25) allows to access the window shown in Figure 11.28b were
the title of the problem is defined as well as the problem type (plane
stress or plane strain), the self-weight load option and the units for the
results.

Hal. 405-406 |Nur Hafidz Hidayat (2006493650) 32


 Lanjutan
Once the boundary conditions and the material properties have been defined it is necessary to
generate the mesh. The sixth button shown in Figure 11.25 is used to create the mesh with the
GiD toolbox facilities. The data file writing is made when pressing the last button shown in
Figure 11.25. All the geometrical and material properties of the problem as well as the boundary
conditions and the loads are written on the data file in the specific reading format for MAT-fem.
Recall that the file name needs the .m extension as shown in Figure 11.29.

11.12.2 Program execution

The problem calculation is performed with MATLAB. The execution does not have other complications than knowing the
directory where the output file will be written. A good practice is to set this directory as the working directory were the
postprocessing file will be also written.

11.12.3 Postprocessing

 Lanjutan Next

Hal. 405-406 |Nur Hafidz Hidayat (2006493650) 33


11.12.3 Postprocessing
Once the problem execution in MATLAB is concluded it is
necessary to return to GiD for the file postprocessing
step in order to analyze the results. The next step is
therefore to open any of the generated files that contain
the extension *.flavia.msh or *.flavia.res.

The results visualization step is performed using


the GiD graphical possibilities which permit to
visualize the results by means of iso-lines, cuts and
graphs. This facilitates the interpretation of the MAT-
fem results.
Figure 11.31 shows an example showing the contours of
the stress alpha in a deep beam clamped at its left end
and loaded by a vertical point load acting on its right end.

Hal. 407-408 |Erriman Manru (2006545673) 34


TERIM
A
KASIH

35

You might also like