-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME
82 lines (66 loc) · 2.69 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
FEM analysis of 1-D second order ordinary differential equation
-------------------------------------------------------------------------------
This program solves the 1-D second order ordinary differential equation:
a d2u/dx2 + b du/dx + c u = f, u(0) = 0, a du/dx at (x = L) = q
where, both u and f are functions of x only. This package is mainly intended
for educational purpose, and it demonstrates a general concept on the
discretization, Gaussian quadrature, stiffness matrix, boundary conditions,
matrix solution, and modular programming.
-------------------------------------------------------------------------------
CITE AS:
Gharti, H. N, 2017: FEM analysis of 1-D second order ordinary differential equation
DOI: 10.13140/RG.2.2.29401.21601
DEVELOPER:
Hom Nath Gharti
formerly at Institute of Engineering, Tribhuvan University, Nepal
formerly at NORSAR, Norway
Department of Geosciences, Princeton University, USA
hngharti_AT_gmail_DOT_com
VERSION:
Fem1D 1.0.0
HISTORY:
Oct 24,2006, HNG: original package created
Apr 25,2017, HNG: modified package
TODO:
- make analytical solution more general
COMPILE:
- go to parent folder
- type: make
RUN:
./bin/fem1d input_file
EXAMPLE:
./bin/fem1d ./input/example.fem
INPUT:
- Input file has the following format:
#----------------------------------------------------------------------------
# Define the 1D second order differential equation:
# a d2u/dx2 + b du/dx + c u = f, u(0) = 0, a du/dx at (x = L) = q
# where, both u and f are functions of x only
a: 1.0
b: 0.0
c: 1.0
f: 10.0
# Define mesh
Length: 10.0
Number of elements: 4
Number of nodes per element: 3
# Define boundary conditions.
# u0 => u(0) and qL => q(L).
u0: 0.0
qL: 10.0
# Compute and save also the exact result for
# a=1, b=0, c=-1, f=10, u0=0, qL=10, L=10
# 1: yes, 0: no
Compute and save exact result: 1
#----------------------------------------------------------------------------
- please see ./input/example.fem file.
OUTPUT:
- computed and analytical (if pexact=1) results can be plotted using plot.dat
or plotTP.dat files. "plot.dat" can be plotted using Gnuplot or any
spreadsheet applications such as LibreOffice calc and Microsoft Excel.
The later file can be viewed in TecPlot.
Note that analytical result is currently computed precisely for the
following parameters: a=1, b=0, c=-1, f=10, u0=0, qL=10, L=10
REFERENCES:
J. N. Reddy, 2005: An Introduction to the Finite Element Method, McGraw-Hill Education, 3rd edition
S. J. Chapman, 2007: Fortran 95/2003 for Scientists & Engineers, McGraw-Hill Education, 3rd Edition