I want to write a 2D FEA code for my course project and I need to import a mesh (2d, simple quad/tri) on a simple geometry such as a L shaped plate or with a square/circular hole in it, something like that.
As I want to write my own code, I need to read the mesh file in my code hence looking for a simple format which specifies element connectivity and help identify boundary nodes (to apply boundary conditions).
It will be really great if you can point out some easy to use/understand tool for this purpose with good documentation on mesh format.
Thank you, Pranav
Edit:
The GMSH is perfectly suited for the use I intended.
Older Edit:
I found this tentative workaround for the problem but is certainly not a solution:
The important part of the file is the information of nodes on corresponding boundaries. I'm using ANSYS DesignModeler and Static structural module in ANSYS Workbench. I'm creating the geometry in DesignModeler and meshing it in ANSYS Meshing which is inside static structural module. You can specify boundaries using Named Selection so that you can apply loads later. After generating the mesh, you can export the input file for an older ANSYS APDL from Tools menu which export a ASCII ".dat" file which has the mesh information and all the problem setup. I removed all unnecessary details to get following results. Now I can easily write a function to read this file.
#Nodes
1 0.000000000E+000 1.000000000E+001 0.000000000E+000
2 0.000000000E+000 0.000000000E+000 0.000000000E+000
3 0.000000000E+000 8.888888889E+000 0.000000000E+000
4 0.000000000E+000 7.777777778E+000 0.000000000E+000
5 0.000000000E+000 6.666666667E+000 0.000000000E+000
6 0.000000000E+000 5.555555556E+000 0.000000000E+000
7 0.000000000E+000 4.444444444E+000 0.000000000E+000
8 0.000000000E+000 3.333333333E+000 0.000000000E+000
9 0.000000000E+000 2.222222222E+000 0.000000000E+000
10 0.000000000E+000 1.111111111E+000 0.000000000E+000
11 5.000000000E+000 0.000000000E+000 0.000000000E+000
12 1.000000000E+000 0.000000000E+000 0.000000000E+000
13 2.000000000E+000 0.000000000E+000 0.000000000E+000
14 3.000000000E+000 0.000000000E+000 0.000000000E+000
15 4.000000000E+000 0.000000000E+000 0.000000000E+000
16 5.000000000E+000 5.000000000E+000 0.000000000E+000
17 5.000000000E+000 1.000000000E+000 0.000000000E+000
18 5.000000000E+000 2.000000000E+000 0.000000000E+000
19 5.000000000E+000 3.000000000E+000 0.000000000E+000
20 5.000000000E+000 4.000000000E+000 0.000000000E+000
21 1.000000000E+001 5.000000000E+000 0.000000000E+000
22 6.000000000E+000 5.000000000E+000 0.000000000E+000
23 7.000000000E+000 5.000000000E+000 0.000000000E+000
24 8.000000000E+000 5.000000000E+000 0.000000000E+000
25 9.000000000E+000 5.000000000E+000 0.000000000E+000
26 1.000000000E+001 1.000000000E+001 0.000000000E+000
27 1.000000000E+001 6.000000000E+000 0.000000000E+000
28 1.000000000E+001 7.000000000E+000 0.000000000E+000
29 1.000000000E+001 8.000000000E+000 0.000000000E+000
30 1.000000000E+001 9.000000000E+000 0.000000000E+000
31 8.888888889E+000 1.000000000E+001 0.000000000E+000
32 7.777777778E+000 1.000000000E+001 0.000000000E+000
33 6.666666667E+000 1.000000000E+001 0.000000000E+000
34 5.555555556E+000 1.000000000E+001 0.000000000E+000
35 4.444444444E+000 1.000000000E+001 0.000000000E+000
36 3.333333333E+000 1.000000000E+001 0.000000000E+000
37 2.222222222E+000 1.000000000E+001 0.000000000E+000
38 1.111111111E+000 1.000000000E+001 0.000000000E+000
39 3.100885795E+000 6.940821089E+000 0.000000000E+000
40 3.883906237E+000 7.027860768E+000 0.000000000E+000
41 3.017869238E+000 6.161626033E+000 0.000000000E+000
42 4.850074589E+000 7.040770750E+000 0.000000000E+000
43 5.864808320E+000 7.043474312E+000 0.000000000E+000
44 6.897973722E+000 7.037079226E+000 0.000000000E+000
45 4.014156390E+000 6.025411191E+000 0.000000000E+000
46 2.984856810E+000 5.187710894E+000 0.000000000E+000
47 2.963924128E+000 4.159491948E+000 0.000000000E+000
48 2.954305198E+000 3.113634563E+000 0.000000000E+000
49 2.966833201E+000 2.070582688E+000 0.000000000E+000
50 1.954872141E+000 3.206756202E+000 0.000000000E+000
51 1.964133590E+000 4.280955357E+000 0.000000000E+000
52 1.987442885E+000 5.363330639E+000 0.000000000E+000
53 2.037966141E+000 6.460608169E+000 0.000000000E+000
54 2.369722555E+000 7.667980533E+000 0.000000000E+000
55 3.585407332E+000 7.997051341E+000 0.000000000E+000
56 4.672581651E+000 8.037841747E+000 0.000000000E+000
57 5.733421173E+000 8.044844080E+000 0.000000000E+000
58 6.801325531E+000 8.036846126E+000 0.000000000E+000
59 7.868898928E+000 8.028595372E+000 0.000000000E+000
60 7.925684523E+000 7.023684703E+000 0.000000000E+000
61 1.963418650E+000 2.132912786E+000 0.000000000E+000
62 4.968222423E+000 6.024805920E+000 0.000000000E+000
63 5.950275027E+000 6.023627968E+000 0.000000000E+000
64 6.960337601E+000 6.022422539E+000 0.000000000E+000
65 7.971188476E+000 6.011697947E+000 0.000000000E+000
66 8.927457869E+000 8.014515675E+000 0.000000000E+000
67 8.961487394E+000 7.010908471E+000 0.000000000E+000
68 2.983632029E+000 1.037919977E+000 0.000000000E+000
69 1.984671847E+000 1.070964476E+000 0.000000000E+000
70 9.864873052E-001 1.087871232E+000 0.000000000E+000
71 9.783216106E-001 2.183930277E+000 0.000000000E+000
72 9.782477164E-001 3.284728024E+000 0.000000000E+000
73 9.781132470E-001 4.382433521E+000 0.000000000E+000
74 9.974305756E-001 5.503140644E+000 0.000000000E+000
75 1.072256462E+000 6.644678490E+000 0.000000000E+000
76 1.150918303E+000 7.757754861E+000 0.000000000E+000
77 1.153760333E+000 8.870140771E+000 0.000000000E+000
78 2.272715412E+000 8.874785514E+000 0.000000000E+000
79 3.378616377E+000 8.955660205E+000 0.000000000E+000
80 4.521905029E+000 9.017703001E+000 0.000000000E+000
81 5.627472506E+000 9.027073068E+000 0.000000000E+000
82 6.720590452E+000 9.025172424E+000 0.000000000E+000
83 7.808554241E+000 9.018864371E+000 0.000000000E+000
84 8.908424832E+000 9.011734730E+000 0.000000000E+000
85 8.986541286E+000 6.005180504E+000 0.000000000E+000
86 3.993993695E+000 5.054644401E+000 0.000000000E+000
87 3.975665129E+000 4.060554879E+000 0.000000000E+000
88 3.974355784E+000 3.051025159E+000 0.000000000E+000
89 3.980336212E+000 2.026422574E+000 0.000000000E+000
90 3.990475831E+000 1.010320637E+000 0.000000000E+000
-1
#Elements
1 39 54 53 41
2 39 40 55 54
3 41 45 40 39
4 45 62 42 40
5 41 46 86 45
6 40 42 56 55
7 53 52 46 41
8 42 43 57 56
9 42 62 63 43
10 43 44 58 57
11 43 63 64 44
12 44 60 59 58
13 44 64 65 60
14 86 16 62 45
15 52 51 47 46
16 47 87 86 46
17 51 50 48 47
18 48 88 87 47
19 50 61 49 48
20 49 89 88 48
21 49 68 90 89
22 61 69 68 49
23 50 72 71 61
24 51 73 72 50
25 52 74 73 51
26 53 75 74 52
27 54 76 75 53
28 54 78 77 76
29 55 79 78 54
30 56 80 79 55
31 57 81 80 56
32 58 82 81 57
33 59 83 82 58
34 59 66 84 83
35 60 67 66 59
36 65 85 67 60
37 71 70 69 61
38 62 16 22 63
39 63 22 23 64
40 64 23 24 65
41 65 24 25 85
42 66 29 30 84
43 67 28 29 66
44 85 27 28 67
45 68 14 15 90
46 69 13 14 68
47 70 12 13 69
48 70 10 2 12
49 71 9 10 70
50 72 8 9 71
51 73 7 8 72
52 74 6 7 73
53 75 5 6 74
54 76 4 5 75
55 77 3 4 76
56 77 38 1 3
57 78 37 38 77
58 79 36 37 78
59 80 35 36 79
60 81 34 35 80
61 82 33 34 81
62 83 32 33 82
63 84 31 32 83
64 84 30 26 31
65 85 25 21 27
66 87 20 16 86
67 88 19 20 87
68 89 18 19 88
69 90 17 18 89
70 90 15 11 17
-1
#NamedSelection
BOTTOM NODE 6
2 11 12 13 14 15
#NamedSelection
TOP NODE 10
1 26 31 32 33 34 35 36
37 38
#NamedSelection
RIGHT_SIDE NODE 6
21 26 27 28 29 30
#End