You are on page 1of 157

TUGAS 9

METODE ELEMEN
HINGGA
2021

Pembahasan MAT
FEM

1
2
PART 1
GID INTERFACE- MAT FEM BEAMS
3
4
GID Interface – MAT-FEM Beams (Bias January Parmadi 2006545572 – M. Jeva Ikramullah 1706035896 )
5
GID Interface – MAT-FEM Beams (Bias January Parmadi 2006545572 – M. Jeva Ikramullah 1706035896 )
6
GID Interface – MAT-FEM Beams (Bias January Parmadi 2006545572 – M. Jeva Ikramullah 1706035896 )
7
GID Interface – MAT-FEM Beams (Bias January Parmadi 2006545572 – M. Jeva Ikramullah 1706035896 )
8
GID Interface – MAT-FEM Beams (Bias January Parmadi 2006545572 – M. Jeva Ikramullah 1706035896 )
9
GID Interface – MAT-FEM Beams (Bias January Parmadi 2006545572 – M. Jeva Ikramullah 1706035896 )
10
GID Interface – MAT-FEM Beams (Bias January Parmadi 2006545572 – M. Jeva Ikramullah 1706035896 )
11
GID Interface – MAT-FEM Beams (Bias January Parmadi 2006545572 – M. Jeva Ikramullah 1706035896 )
PART 2
PROGRAM- MAT FEM BEAMS
EULER BERNOULLI
12
File Utama

Function

Pre-processing MATLAB Program Post-processing


Execution

GID GID
Input file: Output file:
Beam_EulerBernoulliDD *.flavia.msh
*.m _v1_3.m *.flavia.res

Program – MAT FEM Beams Euler Bernoulli(Syaiful Rachman 2006546303 & Asri Puspita Sari S. 2006545534) 13
Beam_Euler Bernoulli_v1.3 Input file example: cant_pun_002.m

Program – MAT FEM Beams Euler Bernoulli(Syaiful Rachman 2006546303 & Asri Puspita Sari S. 2006545534) 14
Beam_Euler Bernoulli_v1.3

Total number of nodes, elements,


DOF

Allocate size of the global matrices

Define material properties (constant)

Program – MAT FEM Beams Euler Bernoulli(Syaiful Rachman 2006546303 & Asri Puspita Sari S. 2006545534) 15
Beam_Euler Bernoulli_v1.3
Start Loop Element

Element stiffness matrix

Equivalent nodal force vector

Program – MAT FEM Beams Euler Bernoulli(Syaiful Rachman 2006546303 & Asri Puspita Sari S. 2006545534) 16
Beam_Euler Bernoulli_v1.3

Assemble element force and stiffness


matrix to global system

End Loop Element

Add point load to force vector


based on ieqn

Apply boundary conditions / restraint


Store 'fixed' node Dof number in array

Program – MAT FEM Beams Euler Bernoulli(Syaiful Rachman 2006546303 & Asri Puspita Sari S. 2006545534) 17
Beam_Euler Bernoulli_v1.3
Solve StifMat * u = force
using only the free node Dof

Compute reactions on the fixed


node Dof

Compute smoothed stresses


using subroutine

Write results to GiD

Program – MAT FEM Beams Euler Bernoulli(Syaiful Rachman 2006546303 & Asri Puspita Sari S. 2006545534) 18
Beam_Euler Bernoulli_v1.3 - Stress_Beam_EulerBernoulliDD_v1.3

parameter input

parameter output
koordinat dan elemen sebagai variabel global

Menentukan dimensi untuk elemen, nodal dan DOF

Looping untuk semua elemen


Ekstraksi nodal pada elemen yang ditinjau
Ekstrak koordinat x pada nodal di elemen yang ditinjau

Program – MAT FEM Beams Euler Bernoulli(Syaiful Rachman 2006546303 & Asri Puspita Sari S. 2006545534) 19
Beam_Euler Bernoulli_v1.3 - Stress_Beam_EulerBernoulliDD_v1.3
Looping untuk setiap nodal
Indeks untuk setiap kelipatan elemen
Looping untuk setiap dof
Menghitung equation number

Ekstrak displacement pada elemen yang ditinjau

dua titik gauss untuk evaluasi tegangan

matriks regangan dan tegangan pada titik gauss 1

matriks regangan dan tegangan pada titik gauss 2

Evaluasi Tegangan

Program – MAT FEM Beams Euler Bernoulli(Syaiful Rachman 2006546303 & Asri Puspita Sari S. 2006545534) 20
Beam_Euler Bernoulli_v1.3 - Timing

Mencatat waktu yang dibutuhkan


selama program ini berjalan
mulai pertama run hingga selesai.

Program – MAT FEM Beams Euler Bernoulli(Syaiful Rachman 2006546303 & Asri Puspita Sari S. 2006545534) 21
Beam_Euler Bernoulli_v1.3 - ToGiD_Beam_EulerBernoulliDD_v1.3
Function ini untuk membuat grafik yang merupakan
representasi hasil pada file utama.

Memberikan parameter input data

koordinat dan elemen sebagai variabel global

Menentukan dimensi untuk elemen, nodal per elemen,


dan nodal.

Menentukan Tipe Elemen

nama file ekstensi pilihan

Program – MAT FEM Beams Euler Bernoulli(Syaiful Rachman 2006546303 & Asri Puspita Sari S. 2006545534) 22
Beam_Euler Bernoulli_v1.3 - ToGiD_Beam_EulerBernoulliDD_v1.3
Command fprintf berfungsi untuk mengubah
hasil menjadi output data text.

Print text untuk mesh file

Print text untuk result file

Program – MAT FEM Beams Euler Bernoulli(Syaiful Rachman 2006546303 & Asri Puspita Sari S. 2006545534) 23
Beam_Euler Bernoulli_v1.3 - ToGiD_Beam_EulerBernoulliDD_v1.3

Print text untuk displacement

Print text untuk rotasi

Print text untuk reaction

Program – MAT FEM Beams Euler Bernoulli(Syaiful Rachman 2006546303 & Asri Puspita Sari S. 2006545534) 24
Beam_Euler Bernoulli_v1.3 - ToGiD_Beam_EulerBernoulliDD_v1.3

Print text untuk reaction moment

Print text untuk momen

Program – MAT FEM Beams Euler Bernoulli(Syaiful Rachman 2006546303 & Asri Puspita Sari S. 2006545534) 25
PART 3
PROGRAM- MAT FEM BEAMS
TIMOSHENKO
26
Beam_Timoshenko_v1.3

1. Mendefinisikan dimensi dasar

2. Medefinisikan dimensi matrik global

3. Mendefinisikan material properties

27
Program – MAT FEM Beams Timoshenko (Erriman Manru / 2006545673)
Beam_Timoshenko_v1.3

4. Mendefinisikan element cycle

5. Mendefinisikan matriks kekakuan Kb

6. Menghitung matriks kekakuan Ks

7. Menghitung matriks kekakuan total elemen


8. Menghitung beban total yang bekerja
28
Program – MAT FEM Beams Timoshenko (Erriman Manru / 2006545673)
Beam_Timoshenko_v1.3

9. Mendefinisikan equation number elemen ke-i dengan


proses looping

10. Mencari vektor gaya dan matrik kekakuan

11. Menambahkan point load ke vektor gaya

29
Program – MAT FEM Beams Timoshenko (Erriman Manru / 2006545673)
Beam_Timoshenko_v1.3
11. Menentukan kondisi batas Dirichlet

12. Menghitung vertical displacement

13. Menghitung reaksi pada perletakan

14. Menghitung tegangan pada nodal

15. Membuat grafik pada GiD_Beam

30
Program – MAT FEM Beams Timoshenko (Erriman Manru / 2006545673)
Beam_Timoshenko_v1.3

31
Program – MAT FEM Beams Timoshenko (Erriman Manru / 2006545673)
Beam_Timoshenko_v1.3 — Stress_Beam_Timoshenko_v1_3.m

Input & output parameters

Get global coordinates & elements

Find basic dimensions

32
Program – MAT FEM Beams Timoshenko (Daniel Alvin Giovanni S. / 2006545591)
Beam_Timoshenko_v1.3 — Stress_Beam_Timoshenko_v1_3.m

Get element's node

Get node's coordinate

Find eq. number list

Recover nodal displacements

33
Program – MAT FEM Beams Timoshenko (Daniel Alvin Giovanni S. / 2006545591)
Beam_Timoshenko_v1.3 — Stress_Beam_Timoshenko_v1_3.m
One Gauss point
Bending strain matrix
Shear strain matrix

Stress evaluation

34
Program – MAT FEM Beams Timoshenko (Daniel Alvin Giovanni S. / 2006545591)
Beam_Timoshenko_v1.3 — ToGiD_Beam_Timoshenko_v1_3.m

Input & output parameters

Get global coordinates & elements

Find basic dimensions

Define element type

Define output file

35
Program – MAT FEM Beams Timoshenko (Daniel Alvin Giovanni S. / 2006545591)
Beam_Timoshenko_v1.3 — ToGiD_Beam_Timoshenko_v1_3.m

Print mesh file

Print results file

36
Program – MAT FEM Beams Timoshenko (Daniel Alvin Giovanni S. / 2006545591)
Beam_Timoshenko_v1.3 — ToGiD_Beam_Timoshenko_v1_3.m

Print displacement results

Print rotation results

Print reaction force results

37
Program – MAT FEM Beams Timoshenko (Daniel Alvin Giovanni S. / 2006545591)
Beam_Timoshenko_v1.3 — ToGiD_Beam_Timoshenko_v1_3.m

Print reaction moment results

Print moment & shear results

38
Program – MAT FEM Beams Timoshenko (Daniel Alvin Giovanni S. / 2006545591)
PART 4
VALIDATIONS- MAT FEM BEAMS
EULER BERNOULLI
39
Cara Run dan Validasi:
MAT-FEM BEAMS EULER BERNOULLI Untuk contoh kasus beban terpusat
File output
File input

File Validasi
40
Program – Validations MAT FEM Beams Euler Bernoulli (Dyah Ayu Aurellia Yasmiin / 1706027080)
Cara Run dan Validasi:
MAT-FEM BEAMS EULER BERNOULLI

File input dari File input dari


folder validasi folder program

Step 1. Pada Matlab, buka salah satu file tipe .m dari folder validasi Beam_Euler_BernoulliDD_V1.3_Examples
Step 2. Buka semua file pada folder program Beam_Euler_BernoulliDD_V1.3
Step 3. Run file validasi (Contoh: file cant_pun_002.m)
Step 4. Run file program utama (Beam_EulerBernoulliDD_v1_3.m)
Step 5. Pada command Window, akan muncul tampilan seperti dibawah ini:

Masukan nama file validasi (Contoh: ‘file cant_pun_002.m’)


Step 6. Untuk melihat hasil displacement, hilangkan tanda ; pada perintah berikut:

Step 7. Run file program utama. Pada command Window, akan muncul tampilan seperti
ini ketika berhasil dijalankan

Program – Validations MAT FEM Beams Euler Bernoulli (Dyah Ayu Aurellia Yasmiin / 1706027080) 41
Cara Run dan Validasi:
MAT-FEM BEAMS EULER BERNOULLI

Step 8. Ketika program berhasil di Run, maka akan muncul file dibawah ini pada folder:

Step 9. Buka file tersebut pada GiD

Step 10. Klik Contour Fill>Displacement>Y-Displ untuk kontur dan klik Deformation>Displacement untuk deformasi

Program – Validations MAT FEM Beams Euler Bernoulli (Dyah Ayu Aurellia Yasmiin / 1706027080) 42
Contoh Soal 1 – Balok Cantilever dengan Beban Terpusat
Input File: Contoh untuk 8 elemen (cant_pun_008.m)
P

L
Diketahui sebuah balok cantilever dengan beban
terpusat P = 5 N, panjang L = 10 m dan properti
material sebagai berikut:

43
Program – Validations MAT FEM Beams Euler Bernoulli (Dyah Ayu Aurellia Yasmiin / 1706027080)
Contoh Soal 1 – Balok Cantilever dengan Beban Terpusat
2 ELEMEN 4 ELEMEN
 Hasil run matlab:  Hasil run matlab:

 Hasil pada GiD:

 Hasil pada GiD:

44
Program – Validations MAT FEM Beams Euler Bernoulli (Dyah Ayu Aurellia Yasmiin / 1706027080)
Contoh Soal 1 – Balok Cantilever dengan Beban Terpusat
8 ELEMEN 16 ELEMEN
 Hasil run matlab:  Hasil run matlab:

 Hasil pada GiD:

 Hasil pada GiD:

45
Program – Validations MAT FEM Beams Euler Bernoulli (Dyah Ayu Aurellia Yasmiin / 1706027080)
Contoh Soal 1 – Balok Cantilever dengan Beban Terpusat
32 ELEMEN 64 ELEMEN
 Hasil run matlab:  Hasil run matlab:

 Hasil pada GiD:  Hasil pada GiD:

46
Program – Validations MAT FEM Beams Euler Bernoulli (Dyah Ayu Aurellia Yasmiin / 1706027080)
Contoh Soal 1 – Balok Cantilever dengan Beban Terpusat
128 ELEMEN 256 ELEMEN
 Hasil run matlab:  Hasil run matlab:

 Hasil pada GiD:  Hasil pada GiD:

47
Program – Validations MAT FEM Beams Euler Bernoulli (Dyah Ayu Aurellia Yasmiin / 1706027080)
Contoh Soal 1 – Balok Cantilever dengan Beban Terpusat
KONVERGENSI HASIL
Pada folder validasi Beam_Euler_BernoulliDD_v1.3_Example terdapat file Excel sebagai perbandingan hasil run.

Maximum Vertical Displacement


0.10%

0.05%

% error
0.00%

-0.05%
Dibandingkan dengan
Solusi eksak hasil run -0.10%
0 30 60 90 120 150
Element

Kesimpulan: Nilai displacement maksimum w pada file validasi dan hasil run bernilai sama yaitu -1. Hasil ini juga
sama jika dibandingkan dengan solusi eksak.

48
Program – Validations MAT FEM Beams Euler Bernoulli (Dyah Ayu Aurellia Yasmiin / 1706027080)
Contoh Soal 2 – Balok Cantilever dengan Beban Merata
Input File: Contoh untuk 4 elemen (Cantilever_4.m)
Q

L
Diketahui sebuah balok cantilever dengan beban
merata Q = -1 N, panjang L = 4 m dan properti
material sebagai berikut:

49
Program – Validations MAT FEM Beams Euler Bernoulli (Agus Mudo Prasetyo / 2006545414)
Contoh Soal 2 – Balok Cantilever dengan Beban Merata
1 ELEMEN 2 ELEMEN
 Hasil run matlab:  Hasil run matlab:

 Hasil pada GiD:  Hasil pada GiD:

50
Program – Validations MAT FEM Beams Euler Bernoulli (Agus Mudo Prasetyo / 2006545414)
Contoh Soal 2 – Balok Cantilever dengan Beban Merata
4 ELEMEN 8 ELEMEN
 Hasil run matlab:  Hasil run matlab:

 Hasil pada GiD:  Hasil pada GiD:

51
Program – Validations MAT FEM Beams Euler Bernoulli (Agus Mudo Prasetyo / 2006545414)
Contoh Soal 2 – Balok Cantilever dengan Beban Merata
16 ELEMEN 32 ELEMEN
 Hasil run matlab:  Hasil run matlab:

 Hasil pada GiD:  Hasil pada GiD:


???

52
Program – Validations MAT FEM Beams Euler Bernoulli (Agus Mudo Prasetyo / 2006545414)
Contoh Soal 2 – Balok Cantilever dengan Beban Merata
64 ELEMEN 128
 Hasil run matlab:  Hasil run matlab: ELEMEN

 Hasil pada GiD:  Hasil pada GiD:

53
Program – Validations MAT FEM Beams Euler Bernoulli (Agus Mudo Prasetyo / 2006545414)
Contoh Soal 2 – Balok Cantilever dengan Beban Merata
KONVERGENSI HASIL
Pada folder validasi Beam_Euler_BernoulliDD_v1.3_Example terdapat file Excel sebagai perbandingan hasil run.

Kesimpulan: Nilai displacement maksimum w pada file validasi dan hasil run bernilai sama yaitu -3150.

54
Program – Validations MAT FEM Beams Euler Bernoulli (Agus Mudo Prasetyo / 2006545414)
PART 5
VALIDATIONS- MAT FEM
BEAMS TIMOSHENKO
55
Validation – MAT Fem Beams Timoshenko
File Validation Discritization

2 Element

4 Element

8 Element

Pembebanan Point Load pada Cantilever 16 Element


Pilih salah satu file untuk di run
32 Element

64 Element

128 Element

256 Element

Validations – MAT FEM Beams Timoshenko (Ida Royana Tambunan 2006545912 & Andreas 1806202992) 56
Validation – MAT Fem Beams Timoshenko

Soal : Beam dimodelkan dengan perletakan jepit dan beban terpusat pada ujung cantilever

Variabel yang diketahui

Elemen

Input variabel

Restrain

Point Load
Koordinat nodal

Validations – MAT FEM Beams Timoshenko (Ida Royana Tambunan 2006545912 & Andreas 1806202992) 57
Validation – MAT Fem Beams Timoshenko

Input nama file

Nodal vertical
displacement

Run Program
Script Utama
Open file dengan ekstension .msh untuk mengeluarkan Cara menampilkan kontur grafik pada GiD
grafik GiD Line thickness > Displacement > Y-Displ

Validations – MAT FEM Beams Timoshenko (Ida Royana Tambunan 2006545912 & Andreas 1806202992) 58
Validation – MAT Fem Beams Timoshenko
2 Element : cant_pun_T002 4 Element : cant_pun_T002

Minimum nodal vertical displacement pada program MATLAB Minimum nodal vertical displacement pada program MATLAB

Grafik Displacement pada Grafik Displacement pada


program GiD program GiD

1 1

Hasil pada Excel Hasil pada Excel

Validations – MAT FEM Beams Timoshenko (Ida Royana Tambunan 2006545912 & Andreas 1806202992) 59
Validation – MAT Fem Beams Timoshenko
8 Element : cant_pun_T002 16 Element : cant_pun_T002

Minimum nodal vertical displacement pada program MATLAB Minimum nodal vertical displacement pada program MATLAB

Grafik Displacement pada Grafik Displacement pada


program GiD program GiD

1 1

Hasil pada Excel Hasil pada Excel

Validations – MAT FEM Beams Timoshenko (Ida Royana Tambunan 2006545912 & Andreas 1806202992) 60
Validation – MAT Fem Beams Timoshenko
32 Element : cant_pun_T002 64 Element : cant_pun_T002

Minimum nodal vertical displacement pada program MATLAB Minimum nodal vertical displacement pada program MATLAB

Grafik Displacement pada Grafik Displacement pada


program GiD program GiD

1 1

Hasil pada Excel Hasil pada Excel

Validations – MAT FEM Beams Timoshenko (Ida Royana Tambunan 2006545912 & Andreas 1806202992) 61
Validation – MAT Fem Beams Timoshenko
128 Element : cant_pun_T002 256 Element : cant_pun_T002

Minimum nodal vertical displacement pada program MATLAB Minimum nodal vertical displacement pada program MATLAB

Grafik Displacement pada Grafik Displacement pada


program GiD program GiD

Hasil pada Excel Hasil pada Excel

Validations – MAT FEM Beams Timoshenko (Ida Royana Tambunan 2006545912 & Andreas 1806202992) 62
Validation – MAT Fem Beams Timoshenko

Input Data

Validations – MAT FEM Beams Timoshenko (Ida Royana Tambunan 2006545912 & Andreas 1806202992) 63
Validation – MAT Fem Beams Timoshenko

Error Vertical Displacement Menurut Jumlah Elemen

Validations – MAT FEM Beams Timoshenko (Ida Royana Tambunan 2006545912 & Andreas 1806202992) 64
Validation – MAT Fem Beams Timoshenko

Error Moment Menurut Jumlah Elemen

Validations – MAT FEM Beams Timoshenko (Ida Royana Tambunan 2006545912 & Andreas 1806202992) 65
PART 6
GID INTERFACE- MAT FEM
66
GID INTERFACE MAT FEM
• The 2D elasticity hypotheses are fulfilled (plane stress or plane strain
• Plane stress problems:
Prismatic structure where one dimension (thickness) is much smaller than the other two,
and loads are contained in its mean plane: deep beams, squares with loads in its plane,
buttress dams , etc

67
GID INTERFACE MAT FEM – (Vania Callista / 1706035984)
GID INTERFACE MAT FEM

1. Install GiD

68
GID INTERFACE MAT FEM – (Vania Callista / 1706035984)
GID INTERFACE MAT FEM

2. Download MAT-fem.gid

69
GID INTERFACE MAT FEM – (Vania Callista / 1706035984)
GID INTERFACE MAT FEM

3. Copy file .gid ke problemtypes pada


file location GiD

70
GID INTERFACE MAT FEM – (Vania Callista / 1706035984)
GID INTERFACE MAT FEM

4. Membuka file graphic user interface


(GUI) pada GiD

71
GID INTERFACE MAT FEM – (Vania Callista / 1706035984)
GID INTERFACE MAT FEM

5. Jika berhasil, akan muncul informasi


bahwa problem type sudah diberikan

72
GID INTERFACE MAT FEM – (Vania Callista / 1706035984)
GID INTERFACE MAT FEM – INPUT DATA

Displacement
Constraints Input Nodal Input Surface
Start Create Geometry
(Boundary (Point) Load Load
Condition)

Create MATLAB
Finish Create Mesh Input Material
Input File

73
GID INTERFACE MAT FEM – (Vania Callista / 1706035984)
GID INTERFACE MAT FEM 2D

74
GID INTERFACE MAT FEM – (Imam Taufik Rahmadi / 2006545931)
GID INTERFACE MAT FEM 2D
Example:

75
GID INTERFACE MAT FEM – (Imam Taufik Rahmadi / 2006545931)
PART 7
GID INTERFACE- MAT FEM 3D
76
This program is the practical application of the finite element method to structural analysis were the 2D elasticity
hypotheses are fulfill (plane stress or plane strain). Also the 3D elasticity assumptions are considered.

There are a plenty of structures where you can make use of 2D elasticity hypothesis:
• Plane stress problems: Prismatic structure where one dimension (thickness) is much smaller than the other two,
and loads are contained in its mean plane: deep beams, squares with loads in its plane, buttress dams , etc .
• Plane strain problems: Prismatic structure where one dimension (length) is much greater than the other two,
and loads are uniformly distributed along its entire length: Retaining Walls, gravity dams, piping internal
pressure and various problems ground engineering (tunnels, stress analysis under pads, etc.,).

Moreover, some structures, by their nature, do not allow the use of simplified models, so it is considered as a
three-dimensional solid and the 3D elasticity general theory is used. Practical examples of such situations include
concrete dams or other complex structure.

77
GID INTERFACE - MAT FEM 3D
File Stress

Buka software
GiD, kemudian
pilih Data
problem type 
Pindahkan file MAT-fem3D
MAT-fem3D.gid
pada folder
Download MAT-
problem types
fem3D.gid pada
http://www.cimne.co
m/mat-fem/2d3d.asp Anda akan masuk ke menu MAT-fem
dengan interface sebagai berikut
78
GID Interface – MAT FEM 3D (Susilo Widyatmoko 2006493871 & Sarah Fatihah Nugroho 200654253)
GID INTERFACE - MAT FEM 3D
Assign Fix Displacement

Tools untuk meng-assign


perletakan dan
displacement awal yang
telah diketahui

79
GID Interface – MAT FEM 3D (Susilo Widyatmoko 2006493871 & Sarah Fatihah Nugroho 200654253)
GID INTERFACE - MAT FEM 3D
Assign Point Load

Tools untuk meng-assign


Point Load

80
GID Interface – MAT FEM 3D (Susilo Widyatmoko 2006493871 & Sarah Fatihah Nugroho 200654253)
GID INTERFACE - MAT FEM 3D
Assign Surface Load

Tools untuk meng-assign


Surface Load

81
GID Interface – MAT FEM 3D (Susilo Widyatmoko 2006493871 & Sarah Fatihah Nugroho 200654253)
GID INTERFACE - MAT FEM 3D
Assign Material

Tools untuk meng-assign


Properti Material seperti
nilai Modulus Young,
Poisson Ratio, Berat
sendiri, dan Tebal.

82
GID Interface – MAT FEM 3D (Susilo Widyatmoko 2006493871 & Sarah Fatihah Nugroho 200654253)
GID INTERFACE - MAT FEM 3D
Generate Mesh

Tools untuk membuat


mesh

83
GID Interface – MAT FEM 3D (Susilo Widyatmoko 2006493871 & Sarah Fatihah Nugroho 200654253)
GID INTERFACE - MAT FEM 3D
Generate Mesh (alternatif)

Tools untuk membuat


mesh

84
GID Interface – MAT FEM 3D (Susilo Widyatmoko 2006493871 & Sarah Fatihah Nugroho 200654253)
GID INTERFACE - MAT FEM 3D
Set Problem Unit

Menentukan satuan yang


digunakan

85
GID Interface – MAT FEM 3D (Susilo Widyatmoko 2006493871 & Sarah Fatihah Nugroho 200654253)
GID INTERFACE - MAT FEM 3D
File cantilever.gid

Mengubah tampilan
mode [geometri/mesh]

86
GID Interface – MAT FEM 3D (Susilo Widyatmoko 2006493871 & Sarah Fatihah Nugroho 200654253)
GID INTERFACE - MAT FEM 3D
File cantilever.gid

Contoh split mesh


menjadi tetrahedra

87
GID Interface – MAT FEM 3D (Susilo Widyatmoko 2006493871 & Sarah Fatihah Nugroho 200654253)
GID INTERFACE - MAT FEM 3D
Write Matlab Input File

ubah extension .dat


menjadi .m

88
GID Interface – MAT FEM 3D (Susilo Widyatmoko 2006493871 & Sarah Fatihah Nugroho 200654253)
GID INTERFACE - MAT FEM 3D

89
GID Interface – MAT FEM 3D (Susilo Widyatmoko 2006493871 & Sarah Fatihah Nugroho 200654253)
GID INTERFACE - MAT FEM 3D
File gravitydam.gid

Show load dan constraint

90
GID Interface – MAT FEM 3D (Susilo Widyatmoko 2006493871 & Sarah Fatihah Nugroho 200654253)
GID INTERFACE - MAT FEM 3D – POST PROCESS

91
GID Interface – MAT FEM 3D (Susilo Widyatmoko 2006493871 & Sarah Fatihah Nugroho 200654253)
GID INTERFACE - MAT FEM 3D – POST PROCESS
File gravitydam.msh

Sii-stress Siii-stress
92
GID Interface – MAT FEM 3D (Susilo Widyatmoko 2006493871 & Sarah Fatihah Nugroho 200654253)
GID INTERFACE - MAT FEM 3D – POST PROCESS
File gravitydam.msh

Reaction Displacement
93
GID Interface – MAT FEM 3D (Susilo Widyatmoko 2006493871 & Sarah Fatihah Nugroho 200654253)
PART 8
PROGRAM- MAT FEM 2D
94
MAT FEM 2D
Ada 9 file, yaitu
1. Timing : durasi running
2. Constt : constitutive matrix
3. QdStif : kekakuan Quadrilateral
4. QdStrs : stress Quadrilateral
5. Stress : looping tegangan di setiap nodal
Download file ini 6. TrStif : kekakuan Triangular
7. TrStrs : tegangan Triangular
8. ToGiD : utk menghasilkan file .flavia.res ke GiD
9. MATfem : PROGRAM UTAMA
Download file ini juga
Berisi input material, koordinat nodal,
konektivitas elemen, dan sebagainya, dari GiD
1. Datos1: Triangular
2. Ejemplo2Lib : Quadrilateral
3. Test1 :Triangular
4. Test2 : Triangular
5. Test3 : Quadrilateral
95
Program – MAT FEM 2D (Alfetra Henoch Tandita 1706036021 & Annisa Ayu Wulandari 2006545515)
MAT FEM 2D

Cara Run MAT FEM 2D:


1. Run file validasi terlebih dahulu (dari GiD),
contoh: file test1.m
2. Buka Program Utama MATfem_v1_3.m lalu ubah
"clear" pada row 4 menjadi "clc"
3. Run program utama MATfem_v1_3.m
4. Enter the name file: 'test1.m'

96
Program – MAT FEM 2D (Alfetra Henoch Tandita 1706036021 & Annisa Ayu Wulandari 2006545515)
MAT FEM 2D
File Program Utama

Plane stress = 1

Properti material: E, v, h, ρ

Koordinat nodal x,y


Konektivitas elemen (3 atau 4)

Fix nodes
Gaya pada nodal

Side load

Input nama file yang berisi


variabel-variabel di atas
97
Program – MAT FEM 2D (Alfetra Henoch Tandita 1706036021 & Annisa Ayu Wulandari 2006545515)
MAT FEM 2D
File Program Utama

Awal perhitungan durasi running program

Menentukan ukuran matriks global


2 DOF per nodal

Membuat matriks global kosong

98
Program – MAT FEM 2D (Alfetra Henoch Tandita 1706036021 & Annisa Ayu Wulandari 2006545515)
MAT FEM 2D
File Program Utama

Properti material -> Script "Constt"

Looping utk seluruh elemen

Koordinat setiap elemen

Perhitungan matriks kekakuan -> TrStif / QdStif

99
Program – MAT FEM 2D (Alfetra Henoch Tandita 1706036021 & Annisa Ayu Wulandari 2006545515)
MAT FEM 2D
File Program Utama

Equation number list

Looping gaya & kekakuan


utk setiap elemen

100
Program – MAT FEM 2D (Alfetra Henoch Tandita 1706036021 & Annisa Ayu Wulandari 2006545515)
MAT FEM 2D
File Program Utama

Side Forces node pertama

Side Forces node kedua

Point Load

101
Program – MAT FEM 2D (Alfetra Henoch Tandita 1706036021 & Annisa Ayu Wulandari 2006545515)
MAT FEM 2D
File Program Utama

Boundary fix nodes

u = K/F

Reaksi perletakan pada fix nodes

102
Program – MAT FEM 2D (Alfetra Henoch Tandita 1706036021 & Annisa Ayu Wulandari 2006545515)
MAT FEM 2D
File Program Utama

Tegangan -> Script 'Stress'

Graphic Representation -> Script 'ToGiD'

103
Program – MAT FEM 2D (Alfetra Henoch Tandita 1706036021 & Annisa Ayu Wulandari 2006545515)
MAT FEM 2D
File QdStif

Output M (kekakuan) dan F (gaya)

104
Program – MAT FEM 2D (Alfetra Henoch Tandita 1706036021 & Annisa Ayu Wulandari 2006545515)
MAT FEM 2D
File QdStif
1/3 Sqrt 3

Matriks kosong M 8x8 dan fy 1x4

Titik Gauss
Matriks Jacobian

Looping utk node 1 - 4


Matriks Bb

105
Program – MAT FEM 2D (Alfetra Henoch Tandita 1706036021 & Annisa Ayu Wulandari 2006545515)
MAT FEM 2D
File QdStrs

Output S

106
Program – MAT FEM 2D (Alfetra Henoch Tandita 1706036021 & Annisa Ayu Wulandari 2006545515)
MAT FEM 2D
File QdStrs
1/3 Sqrt 3

Looping node 1 - 4

S = dmat * bmat * disp

107
Program – MAT FEM 2D (Alfetra Henoch Tandita 1706036021 & Annisa Ayu Wulandari 2006545515)
MAT FEM 2D
File QdStrs

S untuk plane stress S = se

S untuk plane strain ada modifikasi poisson's ratio

108
Program – MAT FEM 2D (Alfetra Henoch Tandita 1706036021 & Annisa Ayu Wulandari 2006545515)
MAT FEM 2D
File ToGiD

Menentukan jumlah elemen dan nodal

Triangular / quadrilateral

Output berupa file .flavia.res utk diproses ke GiD

109
Program – MAT FEM 2D (Alfetra Henoch Tandita 1706036021 & Annisa Ayu Wulandari 2006545515)
MAT FEM 2D
File ToGiD

Print output koordinat

Print output elemen

110
Program – MAT FEM 2D (Alfetra Henoch Tandita 1706036021 & Annisa Ayu Wulandari 2006545515)
MAT FEM 2D
File ToGiD

Print output displacement

Print output reaksi perletakan

111
Program – MAT FEM 2D (Alfetra Henoch Tandita 1706036021 & Annisa Ayu Wulandari 2006545515)
MAT FEM 2D
File ToGiD
Print output tegangan utama
Print output tegangan

112
Program – MAT FEM 2D (Alfetra Henoch Tandita 1706036021 & Annisa Ayu Wulandari 2006545515)
MAT FEM 2D
File TrStif : TrStif_v1_3.m

Function untuk menghitung stiffness matrix


untuk elemen triangular

113
Program – MAT FEM 2D (Alfetra Henoch Tandita 1706036021 & Annisa Ayu Wulandari 2006545515)
MAT FEM 2D
File TrStrs : TrStrs_v1_3.m

Function untuk mengevaluasi stresses untuk


elemen triangular

114
Program – MAT FEM 2D (Alfetra Henoch Tandita 1706036021 & Annisa Ayu Wulandari 2006545515)
MAT FEM 2D
File Constt : constt.m

Function untuk menghitung constitutive matrix


115
Program – MAT FEM 2D (Alfetra Henoch Tandita 1706036021 & Annisa Ayu Wulandari 2006545515)
MAT FEM 2D
File Timing : timing.m

Mengevaluasi dan akumulasi waktu yang dibutuhkan untuk merunning program

116
Program – MAT FEM 2D (Alfetra Henoch Tandita 1706036021 & Annisa Ayu Wulandari 2006545515)
MAT FEM 2D
File Stress : Stress_v1_3.m

117
Program – MAT FEM 2D (Alfetra Henoch Tandita 1706036021 & Annisa Ayu Wulandari 2006545515)
PART 9
PROGRAM- MAT FEM 3D
118
MAT-FEM 3D_V1.2
File Data

Function .m :​
HeStif3D : Kekakuan & Vektor Gaya Hexahedron​
HeStrs3D : Tegangan Hexahedron​

Main Program

Function .m :​
QdFor3D : Force Vector Quadrilateral​
Rotation system : Matriks Rotasi​
Stress3D : Looping Tegangan di setiap nodal​
TeStif3D : Kekakuan & Vektor Gaya Tetrahedron ​
TeStrs3D : Tegangan Tetrahedron ​
timing : Durasi Running​
ToGiD3D : Menghasilkan file .flavia.res ke GiD​
TrFor3D : Force Vector Triangular

119
Program – MAT FEM 3D_v1.2 (Nur Hafidz Hidayat 2009493650 )
MAT-FEM 3D_V1.2
Informasi Terkait keperluan apa saja
Data yang perlu di INPUT

Material
Nodal
Elements Inputan file nya
Restrain ada di program
Point Load Validation
Surface Load

120
Program – MAT FEM 3D_v1.2 (Nur Hafidz Hidayat 2009493650)
Program Utama
tic; % Start clock
ttim = 0; % Initialize time counter
eval(file_name); % Read input file

% Find basic dimensions


npnod = size(coordinates,1); % Number of nodes
nndof = 3*npnod; % Number of total DOF
nelem = size(elements,1); % Number of elements Menentukan size Matrix Global 3 DOF per node
nnode = size(elements,2); % Number of nodes per element
neleq = nnode*3; % Number of DOF per element

elements = sortrows(elements);

ttim = timing('Time needed to read the input file',ttim); %Reporting time function t = timing(text,time)

% Dimension the global matrices


StifMat = sparse( nndof , nndof ); % Create the global stiffness matrix
force = sparse( nndof , 1 ); % Create the global force vector
force1 = sparse( nndof , 1 ); % Create the global force vector Created Matrix Global Zeros
reaction = sparse( nndof , 1 ); % Create the global reaction vector

% Material properties (Constant over the domain)


aux1 = young*(1-poiss)/((1+poiss)*(1-2*poiss));
aux2 = poiss/(1-poiss);
aux3 = (1-2*poiss)/(2*(1-poiss));

dmat = [ 1 , aux2, aux2, 0 , 0 , 0 ; Data informasi Material Properties


aux2, 1 , aux2, 0 , 0 , 0 ;
aux2, aux2, 1 , 0 , 0 , 0 ;
0 , 0 , 0 , aux3, 0 , 0 ;
0 , 0 , 0 , 0 , aux3, 0 ;
0 , 0 , 0 , 0 , 0 , aux3 ];
dmat = dmat*aux1;

ttim = timing('Time needed to set initial values',ttim); %Reporting time function t = timing(text,time)

121
Program – MAT FEM 3D_v1.2 (Nur Hafidz Hidayat 2009493650 )
Program Utama
% Element cycle
for ielem = 1 : nelem Looping untuk ke seluruh elemen

% Recover element properties


lnods = elements(ielem,:); % Elem. connectivity
Koordinat Setiap Elemen
coord(1:nnode,:) = coordinates(lnods(1:nnode),:); % Elem. coordinates

% Evaluate the elemental stiffness matrix and mass force vector


if (nnode == 4) % 4 Nds tetrahedron
[ElemMat,ElemFor] = TeStif3D_v1_2(coord,dmat,denss); function [M,F] = TeStif3D_v1_2(nodes,dmat,denss)
else % 8 Nds hexahedron
[ElemMat,ElemFor] = HeStif3D_v1_2(coord,dmat,denss); function [M,F] = HeStif3D_v1_2(nodes,dmat,denss)
end

% Find the equation number list for the i-th element


eqnum = []; % Clear the list
for i =1 : nnode % Node cycle Equation list number
eqnum = [eqnum,lnods(i)*3-2,lnods(i)*3-1,lnods(i)*3]; % Build eq.
end % number list

% Assemble the force vector and the stiffness matrix


force(eqnum) = force(eqnum) + ElemFor'; Loooping force & stiffeness for each element
StifMat(eqnum,eqnum) = StifMat(eqnum,eqnum) + ElemMat;

end
% End element cycle

ttim = timing('Time to assemble the global system',ttim); %Reporting time function t = timing(text,time)

122
Program – MAT FEM 3D_v1.2 (Nur Hafidz Hidayat 2009493650 )
Program Utama
% Add global side forces to the force vector
coord = []; % Clear coordinates
nloads = size(surfaceload,1); Inputan Data ada di file validation
if (nloads ~= 0)
nsnod = size(surfaceload,2) - 4;
for i = 1 : nloads
lnods = surfaceload(i,1:nsnod); %Elem. connectivity
coord(1:nsnod,:) = coordinates(lnods(1:nsnod),:); %Elem. coordinates
sidfo(1:3) = surfaceload(i,nsnod+1:nsnod+3);
loc_code = surfaceload(i,nsnod+4);

% Find the equation number list for the i-th element


eqnum = []; % Clear the list
for j =1 : nsnod % Node cycle
eqnum = [eqnum,lnods(j)*3-2,lnods(j)*3-1,lnods(j)*3]; % Build eq.
end % number list
if (nsnod == 3) % 3 Nds triangular face
SideFor = TrFor3D_v1_2(coord,sidfo,loc_code); function F = TrFor3D_v1_2(nodes,force,loc_code)
else % 4 Nds quadrilateral face
SideFor = QdFor3D_v1_2(coord,sidfo,loc_code); function F = QdFor3D_v1_2(nodes,force,loc_code)
end
force(eqnum) = force(eqnum) + SideFor';
end
end

% Add point load conditions to the force vector


for i = 1 : size(pointload,1)
ieqn = (pointload(i,1)-1)*3 + pointload(i,2); % Find eq. number
force(ieqn) = force(ieqn) + pointload(i,3); % Add the force
end

ttim = timing('Time for apply side and point load',ttim); %Reporting time function t = timing(text,time)

123
Program – MAT FEM 3D_v1.2 (Nur Hafidz Hidayat 2009493650)
Program Utama
% Apply the Dirichlet conditions and adjust the right hand side
u = sparse( nndof, 1 );
for i = 1 : size(fixnodes,1) Boundary Condition
ieqn = (fixnodes(i,1)-1)*3 + fixnodes(i,2); % Find the equation number
u(ieqn) = fixnodes(i,3); % and store the solution in u
fix(i) = ieqn; % and mark the eq. as a fix value
end

force1 = force - StifMat * u; % Adjust the rhs with the known values
% Compute the solution by solving StifMat * u = force for the remaining
% unknown values of u
FreeNodes = setdiff(1:nndof,fix); % Find the free node list and
% solve for it Deformasi u
u(FreeNodes) = StifMat(FreeNodes,FreeNodes) \ force1(FreeNodes);

% Compute the reactions on the fixed nodes as R = StifMat * u - F


reaction(fix) = StifMat(fix,1:nndof) * u(1:nndof) - force(fix);

ttim = timing('Time to solve the stiffness matrix',ttim); %Reporting time function t = timing(text,time)

% Compute the stresses


Strnod = Stress3D_v1_2(dmat,u); function S = Stress3D_v1_2(dmat,u)

ttim = timing('Time to solve the nodal stresses',ttim); %Reporting time function t = timing(text,time)

% Graphic representation
ToGiD3D_v1_2(file_name,u,reaction,Strnod); function ToGiD3D_v1_2(file_name,u,reaction,Strnod)

ttim = timing('Time used to write the solution',ttim); %Reporting time function t = timing(text,time)
itim = toc; %Close last tic
fprintf(1,'\nTotal running time %12.6f \n\n',ttim); %Reporting final time function t = timing(text,time)

124
Program – MAT FEM 3D_v1.2 (Nur Hafidz Hidayat 2009493650 )
function [M,F] = HeStif3D_v1_2(nodes,dmat,denss)
Hexagon Element pospg = [ -0.577350269189626E+00 , 0.577350269189626E+00 ];
pespg = [ 1.0E+00 , 1.0E+00 ];
%% HeStif3D Evaluates the stiffness matrix and the mass force vector for M = zeros(24,24); Matrix zeros [M]
a fy = zeros(1,8);
% hexahedron element
% for i = 1 : 2
% Parameters: for j = 1 : 2
% for k = 1 : 2
% Input, nodes : Contains the 3D coordinates of the element nodes lcffm = fform(pospg(i),pospg(j),pospg(k)); % SF at gauss point
% dmat : Constitutive matrix lcder = deriv(pospg(i),pospg(j),pospg(k)); % SF Local derivatives
% denss : Density xjacm = lcder*nodes; % Jacobian matrix
% ctder = xjacm\lcder; % SF Cartesian derivates
% Output, M the element local stiffness matrix dvol = det(xjacm)*pespg(i)*pespg(j)*pespg(k);
% F the element local force vector
shape function bmat = [];
fform = @(s,t,v)[(1-s)*(1-t)*(1-v)/8,(1+s)*(1-t)*(1-v)/8,... for inode = 1 : 8 Looping dengan inode : dari node 1  8
(1+s)*(1+t)*(1-v)/8,(1-s)*(1+t)*(1-v)/8,... bmat = [ bmat ,[ctder(1,inode), 0 , 0 ;
(1-s)*(1-t)*(1+v)/8,(1+s)*(1-t)*(1+v)/8,... 0 ,ctder(2,inode), 0 ;
(1+s)*(1+t)*(1+v)/8,(1-s)*(1+t)*(1+v)/8]; 0 , 0 ,ctder(3,inode);
Natural derivative ctder(2,inode),ctder(1,inode), 0 ;
ctder(3,inode), 0 ,ctder(1,inode);
deriv = @(s,t,v)[-(1-t)*(1-v)/8, (1-t)*(1-v)/8,... 0 ,ctder(3,inode),ctder(2,inode)]];
(1+t)*(1-v)/8,-(1+t)*(1-v)/8,... end
-(1-t)*(1+v)/8, (1-t)*(1+v)/8,... Local Stiffness matrix
(1+t)*(1+v)/8,-(1+t)*(1+v)/8 ; M = M + (bmat'*dmat*bmat*dvol);
-(1-s)*(1-v)/8,-(1+s)*(1-v)/8,...
(1+s)*(1-v)/8, (1-s)*(1-v)/8,... fy = fy + lcffm*denss*dvol;
-(1-s)*(1+v)/8,-(1+s)*(1+v)/8,...
(1+s)*(1+v)/8, (1-s)*(1+v)/8 ; end
-(1-s)*(1-t)/8,-(1+s)*(1-t)/8,... end
-(1+s)*(1+t)/8,-(1-s)*(1+t)/8,... end
(1-s)*(1-t)/8, (1+s)*(1-t)/8,... Local force vector
(1+s)*(1+t)/8, (1-s)*(1+t)/8 ]; F = [ 0, 0,-fy(1), 0, 0,-fy(2), 0, 0,-fy(3), 0, 0,-fy(4), ...
0, 0,-fy(5), 0, 0,-fy(6), 0, 0,-fy(7), 0, 0,-fy(8)];

125
Program – MAT FEM 3D_v1.2 (Nur Hafidz Hidayat 2009493650 )
function F = QdFor3D_v1_2(nodes,force,loc_code)

%% QdFor3D Evaluates the global force vector for a quadrilateral face fx = zeros(1,4);
% fy = zeros(1,4); Matrix kosong
% Parameters: fz = zeros(1,4);
%
% Input, nodes : Contains the 3D coordinates of the element nodes for i = 1 : 2
% force : Side force vector for j = 1 : 2
% loc_code : Local(1) or Global(2) force code lcffm = fform(pospg(i),pospg(j)); % SF at gauss point
% lcder = deriv(pospg(i),pospg(j)); % SF Local derivatives
% Output, F the element local force vector xjacm = lcder*ctxy(1:4,1:2); % Jacobian matrix
darea = det(xjacm)*pespg(i)*pespg(j);
fform = @(s,t)[(1-s-t+s*t)/4,(1+s-t-s*t)/4,(1+s+t+s*t)/4,(1-s+t-s*t)/4];
deriv = @(s,t)[(-1+t)/4,( 1-t)/4,( 1+t)/4,(-1-t)/4; fx = fx + lcffm*darea*force(1);
(-1+s)/4,(-1-s)/4,( 1+s)/4,( 1-s)/4]; fy = fy + lcffm*darea*force(2); Force arah x y z
fz = fz + lcffm*darea*force(3);
pospg = [ -0.577350269189626E+00 , 0.577350269189626E+00 ]; end
pespg = [ 1.0E+00 , 1.0E+00 ]; end
fy = zeros(1,8); Matrix kosong The elemen local force vector
F = [fx(1),fy(1),fz(1),fx(2),fy(2),fz(2),...
Te = Rotation_system_v1_2(nodes); fx(3),fy(3),fz(3),fx(4),fy(4),fz(4)];
ctxy = nodes*Te'; % Rotate coordinates to element mid plane
function Te = Rotation_system_v1_2(cxyz)
if (loc_code == 1)
force = Te'*force';
end

126
Program – MAT FEM 3D_v1.2 (Nur Hafidz Hidayat 2009493650 & Salfa Zarfatina 1706035845)
function S = Stress3D_v1_2(dmat,u)

%% Stress3D Evaluates the stresses at the Gauss points and smooth the % Find the equation number list for the i-th element
% values to the nodes eqnum = []; % Clear the list
% for i =1 : nnode % Node cycle
% Parameters: eqnum = [eqnum,lnods(i)*3-2,lnods(i)*3-1,lnods(i)*3]; % Build eq.
% end % number list
% Input, dmat : Constitutive matrix
% u : Nodal displacements displ = u(eqnum);
%
% Output, S the nodal stress matrix (nnode, nstrs) % Evaluate the elemental stress vector
if (nnode == 4)
global coordinates; ElemStr = TeStrs3D_v1_2(coord,dmat,displ);
global elements; % 4 Nds tetrahedron
for j = 1 : nstrs
nelem = size(elements,1); % Number of elements nodstr(lnods,j) = nodstr(lnods,j) + ElemStr(j);
nnode = size(elements,2); % Number of nodes per element end
npnod = size(coordinates,1); % Number of nodes nodstr(lnods,nstrs+1) = nodstr(lnods,nstrs+1) + 1;
nstrs = 6; else
ElemStr = HeStrs3D_v1_2(coord,dmat,displ);
nodstr = zeros(npnod,nstrs+1); % 8 Nds hexahedron
for j = 1 : nstrs
% Element cycle for k = 1 : nnode
for ielem = 1 : nelem Looping untuk ke seluruh elemen nodstr(lnods(k),j) = nodstr(lnods(k),j) + ElemStr(k,j);
end
% Recover element properties end
lnods = elements(ielem,:); % Elem. connectivity nodstr(lnods,nstrs+1) = nodstr(lnods,nstrs+1) + 1;
coord(1:nnode,:) = coordinates(lnods(1:nnode),:); % Elem. coordinates end

end % End element cycle


S = []; The nodel stress matrix (node, nstrs)
for i = 1 : npnod
S = [ S ; nodstr(i,1:nstrs)/nodstr(i,nstrs+1) ];
end
127
Program – MAT FEM 3D_v1.2 (Nur Hafidz Hidayat 2009493650 )
function ToGiD3D_v1_2(file_name,u,reaction,Strnod)

%% TeStrs3D Evaluates the stresses for a tetrahedron element


%
% Parameters:
%
% Input, nodes : Contains the 3D coordinates of the element nodes
% dmat : Constitutive matrix
% displ : Nodal displacements
%
% Output, S the element constant stress vector

deriv = @(s,t,v)[-1, 1, 0, 0;
-1, 0, 1, 0;
-1, 0, 0, 1];

lcder = deriv(1/4,1/4,1/4) ; % SF Local derivatives


xjacm = lcder*nodes ; % Jacobian matrix
ctder = xjacm\lcder ; % SF Cartesian derivates

bmat = [];
for inode = 1 : 4 Looping dengan inode : dari node 1  4
bmat = [ bmat ,[ctder(1,inode), 0 , 0 ;
0 ,ctder(2,inode), 0 ;
0 , 0 ,ctder(3,inode);
ctder(2,inode),ctder(1,inode), 0 ;
ctder(3,inode), 0 ,ctder(1,inode);
0 ,ctder(3,inode),ctder(2,inode)]];
end

S = dmat*bmat*displ; The elemen constrant stress vector

128
Program – MAT FEM 3D_v1.2 (Nur Hafidz Hidayat 2009493650 )
function ToGiD3D_v1_2(file_name,u,reaction,Strnod)
% Mesh File Plotting Bentuk Mesh
fid = fopen(msh_file,'w');
function ToGiD3D_v1_2(file_name,u,reaction,Strnod) fprintf(fid,'### \n');
fprintf(fid,'# MAT-fem3D v1.2 \n');
%% ToGiD3D Writes the postprocess files fprintf(fid,'# \n');
% fprintf(fid,'MESH dimension %3.0f Elemtype %s Nnode %2.0f \n \
% Parameters: n',3,eletyp,nnode);
% fprintf(fid,'coordinates \n');
% Input, file_name : GiD File name for i = 1 : npnod
% u : Nodal displacements fprintf(fid,'%6.0f %12.5d %12.5d %12.5d \n',i,coordinates(i,:));
% reaction : Reactions on fixed nodes end
% Strnod : Nodal Stresses fprintf(fid,'end coordinates \n \n');
% fprintf(fid,'elements \n');
% Output, none if (nnode == 4)
for i = 1 : nelem
global coordinates; fprintf(fid,'%6.0f %6.0f %6.0f %6.0f %6.0f 1 \n',i,elements(i,:));
global elements; end
else
nelem = size(elements,1); % Number of elements for i = 1 : nelem
nnode = size(elements,2); % Number of nodes per element fprintf(fid,'%6.0f %6.0f %6.0f %6.0f %6.0f %6.0f %6.0f %6.0f %6.0f
npnod = size(coordinates,1); % Number of nodes 1 \n',i,elements(i,:));
end
if (nnode == 4) end
eletyp = 'Tetrahedra'; fprintf(fid,'end elements \n \n');
else Type strd Node, Tetra or Hexa
eletyp = 'Hexahedra'; hedra
status = fclose(fid);
end
% Results File Hasil file yang keluar
msh_file = strcat(file_name,'.flavia.msh'); fid = fopen(res_file,'w');
res_file = strcat(file_name,'.flavia.res'); fprintf(fid,'Gid Post Results File 1.0 \n');
fprintf(fid,'### \n');
fprintf(fid,'# MAT-fem3D v1.2 \n');
fprintf(fid,'# \n');

129
Program – MAT FEM 3D_v1.2 (Nur Hafidz Hidayat 2009493650 )
function ToGiD3D_v1_2(file_name,u,reaction,Strnod)

Output Stress Data


Output Displacment Data % Stress
% Displacement fprintf(fid,'Result "Stress" "Load Analysis" 1 Matrix OnNodes \n');
fprintf(fid,'Result "Displacement" "Load Analysis" 1 Vector OnNodes \n'); fprintf(fid,'ComponentNames "Sx", "Sy", "Sz", "Sxy", "Syz", "Sxz" \n');
fprintf(fid,'ComponentNames "X-Displ", "Y-Displ", "Z-Displ" \n'); fprintf(fid,'Values \n');
fprintf(fid,'Values \n');
for i = 1 : npnod for i = 1 : npnod
fprintf(fid,'%6.0i %13.5d %13.5d %13.5d \n', ... fprintf(fid,'%6.0f %12.5d %12.5d %12.5d %12.5d %12.5d %12.5d \
i,full(u(i*3-2)),full(u(i*3-1)),full(u(i*3))); n',i,Strnod(i,:));
end end
fprintf(fid,'End Values \n');
fprintf(fid,'# \n'); fprintf(fid,'End Values \n');
status = fclose(fid);
Output Force Data
% Reaction Force
fprintf(fid,'Result "Reaction Force" "Load Analysis" 1 Vector OnNodes \
n');
fprintf(fid,'ComponentNames "Rx", "Ry", "Rz" \n');
fprintf(fid,'Values \n');
for i = 1 : npnod
fprintf(fid,'%6.0f %12.5d %12.5d %12.5d \n', ...
i,full(reaction(i*3-2)),full(reaction(i*3-1)),full(reaction(i*3)));
end
fprintf(fid,'End Values \n');
fprintf(fid,'# \n');

130
Program – MAT FEM 3D_v1.2 (Nur Hafidz Hidayat 2009493650 )
MAT FEM 3D
File Timing

Menampilkan durasi yang dibutuhkan


program sejak di running

131
Program – MAT FEM 3D ( Salfa Zarfatina 1706035845)
MAT FEM 3D
File TeStif3D_v1_2

Function untuk menghitung


stiffness matrix dan force vector
elemen Tetrahedron

Initial element shape function

Natural derivative
Shape function di titik gauss

Volume differential

132
Program – MAT FEM 3D (Salfa Zarfatina 1706035845)
MAT FEM 3D
File TeStif3D_v1_2

Looping untuk node 1-4


Matriks B (strain matrix)

Matriks M (the element local stiffness matrix)


The equivalent nodal force vector for the self weight
The element local force vector

133
Program – MAT FEM 3D ( Salfa Zarfatina 1706035845)
MAT FEM 3D
File HeStrs3D_v1_2

Function untuk menghitung stress


vector elemen Hexahedron

Initial element shape function

Natural derivative

134
Program – MAT FEM 3D ( Salfa Zarfatina 1706035845)
MAT FEM 3D
File HeStrs3D_v1_2
Gauss point coordinate values
Gauss point coordinate weights
Matriks Kosong strsg dan extrap

Looping untuk node 1-8


Matriks B (strain matrix)

Nilai stress component di setiap Gauss point

Coordinat values a,b,c

Extrapolation Shape Function

Stress Vector di local node


135
Program – MAT FEM 3D ( Salfa Zarfatina 1706035845)
MAT FEM 3D
File TrFor3D_v1_2

Function yang menghitung/


mengevaluasi force vector
untuk triangular face
Initial element shape function
Natural derivative
function Te = Rotation_system_v1_2(cxyz)

Force pada local code

Shape function di titik gauss

Area differential

Force arah x, y, z
Elemen local force vector
136
Program – MAT FEM 3D ( Salfa Zarfatina 1706035845)
MAT FEM 3D
File Rotation_system_v1_2

Function untuk menghitung m


atriks rotasi

Elemen

Vektor (vze)

Panjang Vektor (vze)


137
Program – MAT FEM 3D ( Salfa Zarfatina 1706035845)
MAT FEM 3D
File Rotation_system_v1_2

Unit vector normal to element surface (vze)

XZ plane intesection with element surface

Vektor (vye)
Panjang Vektor (vye)
Unit vector normal to element surface (vye)

Rotation Matrix
138
Program – MAT FEM 3D (Salfa Zarfatina 1706035845)
PART 10
VALIDATION- MAT FEM 2D
139
MAT FEM 2D

140
Validasi– MAT FEM 2D (Vivin Novi Adryana- 2006546373)
MAT FEM 2D

141
Validasi– MAT FEM 2D (Vivin Novi Adryana- 2006546373)
MAT FEM 2D

142
Validasi– MAT FEM 2D (Vivin Novi Adryana- 2006546373)
MAT FEM 2D

143
Validasi– MAT FEM 2D (Vivin Novi Adryana- 2006546373)
MAT FEM 2D

144
Validasi– MAT FEM 2D (Vivin Novi Adryana- 2006546373)
MAT FEM 2D

145
Validasi– MAT FEM 2D (Vivin Novi Adryana- 2006546373)
MAT FEM 2D

146
Validasi– MAT FEM 2D (Vivin Novi Adryana- 2006546373)
MAT FEM 2D

147
Validasi– MAT FEM 2D (Vivin Novi Adryana- 2006546373)
MAT FEM 2D

148
Validasi– MAT FEM 2D (Vivin Novi Adryana- 2006546373)
PART 11
VALIDATION- MAT FEM 3D
149
MAT FEM 3D

150
Validation – MAT FEM 3D (Imam Nakhrowi 2006545925)
MAT FEM 3D

151
Validation – MAT FEM 3D (Imam Nakhrowi 2006545925)
Cara Run:
MAT-FEM 3D

Step 1. Pada Matlab, buka salah satu file Cantilever.m atau Gravity_Dam.m dari folder validasi MAT-fem3D_v1.2_Examples
Step 2. Run file MATfem3D_v1_2 pada folder MAT-fem3D_v1.2
Step 3. Pada command Window, akan muncul tampilan seperti dibawah ini:

Masukan nama file validasi (Cantilever)


Step 4. Pada command Window klik enter setelah menuliskan nama file validasi akan muncul tampilan seperti di bawah

Validation – MAT FEM 3D (Imam Nakhrowi 2006545925) 152


Cara Run dan Validasi:
MAT-FEM 3D

Step 5. Ketika program berhasil di Run, maka akan muncul file dibawah ini pada folder:

Step 6. Buka file dengan ekstensi .msh tersebut pada GiD


Step 7. Untuk melihat output dari program matlab yang tadi dibuat dapat dengan
Klik bar View result dan klik output yang ingin dilihat

Validation – MAT FEM 3D (Imam Nakhrowi 2006545925) 153


MAT FEM 3D
Contoh Soal 1 – Balok Cantilever Element

Restrain
Material Properties

Node
Surface Load

154
Validation – MAT FEM 3D (Imam Nakhrowi 2006545925)
MAT FEM 3D
Contoh Soal 1 – Balok Cantilever

Deformasi Arah Z
global Hasil GiD

Deformasi Arah
Z global Hasil
MatLab
155
Validation – MAT FEM 3D (Imam Nakhrowi 2006545925)
MAT FEM 3D
Contoh Soal 2 – Gravity Dam Element

Restrain
Material Properties

Node
Surface Load

156
Validation – MAT FEM 3D (Imam Nakhrowi 2006545925)
MAT FEM 3D
Contoh Soal 1 – Balok Cantilever

Deformasi Arah Z
global Hasil GiD

Deformasi Arah
Z global Hasil
MatLab
157
Validation – MAT FEM 3D (Imam Nakhrowi 2006545925)

You might also like