Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement loading of meshes from MSH files #15

Merged
merged 15 commits into from
Dec 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ fenris-sparse = { version= "0.0.2", path = "fenris-sparse" }
fenris-geometry = { version= "^0.0.5", path = "fenris-geometry", features = [ "proptest" ] }
fenris-optimize = { version= "0.0.2", path = "fenris-optimize" }
fenris-quadrature = { version= "0.0.4", path = "fenris-quadrature" }
mshio = "0.4.2"

[dev-dependencies]
fenris = { path = ".", features = [ "proptest-support" ]}
Expand Down
273 changes: 273 additions & 0 deletions assets/meshes/cube_hex27_8.msh
Original file line number Diff line number Diff line change
@@ -0,0 +1,273 @@
$MeshFormat
4.1 0 8
$EndMeshFormat
$Entities
0 0 0 1
0 0 0 0 1 1 1 0 0
$EndEntities
$Nodes
1 125 1 125
3 0 0 125
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
0 0 0
0.5 0 0
1 0 0
0 0.5 0
0.5 0.5 0
1 0.5 0
0 1 0
0.5 1 0
1 1 0
0 0 0.5
0.5 0 0.5
1 0 0.5
0 0.5 0.5
0.5 0.5 0.5
1 0.5 0.5
0 1 0.5
0.5 1 0.5
1 1 0.5
0 0 1
0.5 0 1
1 0 1
0 0.5 1
0.5 0.5 1
1 0.5 1
0 1 1
0.5 1 1
1 1 1
0.25 0 0
0 0.25 0
0 0 0.25
0.5 0.25 0
0.5 0 0.25
0.25 0.5 0
0.5 0.5 0.25
0 0.5 0.25
0.25 0 0.5
0 0.25 0.5
0.5 0.25 0.5
0.25 0.5 0.5
0.25 0.25 0
0.25 0 0.25
0 0.25 0.25
0.5 0.25 0.25
0.25 0.5 0.25
0.25 0.25 0.5
0.25 0.25 0.25
0.75 0 0
1 0.25 0
1 0 0.25
0.75 0.5 0
1 0.5 0.25
0.75 0 0.5
1 0.25 0.5
0.75 0.5 0.5
0.75 0.25 0
0.75 0 0.25
1 0.25 0.25
0.75 0.5 0.25
0.75 0.25 0.5
0.75 0.25 0.25
0 0.75 0
0.5 0.75 0
0.25 1 0
0.5 1 0.25
0 1 0.25
0 0.75 0.5
0.5 0.75 0.5
0.25 1 0.5
0.25 0.75 0
0 0.75 0.25
0.5 0.75 0.25
0.25 1 0.25
0.25 0.75 0.5
0.25 0.75 0.25
1 0.75 0
0.75 1 0
1 1 0.25
1 0.75 0.5
0.75 1 0.5
0.75 0.75 0
1 0.75 0.25
0.75 1 0.25
0.75 0.75 0.5
0.75 0.75 0.25
0 0 0.75
0.5 0 0.75
0.5 0.5 0.75
0 0.5 0.75
0.25 0 1
0 0.25 1
0.5 0.25 1
0.25 0.5 1
0.25 0 0.75
0 0.25 0.75
0.5 0.25 0.75
0.25 0.5 0.75
0.25 0.25 1
0.25 0.25 0.75
1 0 0.75
1 0.5 0.75
0.75 0 1
1 0.25 1
0.75 0.5 1
0.75 0 0.75
1 0.25 0.75
0.75 0.5 0.75
0.75 0.25 1
0.75 0.25 0.75
0.5 1 0.75
0 1 0.75
0 0.75 1
0.5 0.75 1
0.25 1 1
0 0.75 0.75
0.5 0.75 0.75
0.25 1 0.75
0.25 0.75 1
0.25 0.75 0.75
1 1 0.75
1 0.75 1
0.75 1 1
1 0.75 0.75
0.75 1 0.75
0.75 0.75 1
0.75 0.75 0.75
$EndNodes
$Elements
1 8 1 8
3 0 12 8
1 1 2 5 4 10 11 14 13 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
2 2 3 6 5 11 12 15 14 47 31 32 48 49 50 51 34 52 38 53 54 55 56 43 57 58 59 60
3 4 5 8 7 13 14 17 16 33 61 35 62 34 63 64 65 39 66 67 68 69 44 70 71 72 73 74
4 5 6 9 8 14 15 18 17 50 62 34 75 51 76 77 64 54 67 78 79 80 58 71 81 82 83 84
5 10 11 14 13 19 20 23 22 36 37 85 38 86 39 87 88 89 90 91 92 45 93 94 95 96 97 98
6 11 12 15 14 20 21 24 23 52 38 86 53 99 54 100 87 101 91 102 103 59 104 95 105 106 107 108
7 13 14 17 16 22 23 26 25 39 66 88 67 87 68 109 110 92 111 112 113 73 96 114 115 116 117 118
8 14 15 18 17 23 24 27 26 54 67 87 78 100 79 119 109 103 112 120 121 83 106 115 122 123 124 125
$EndElements
77 changes: 77 additions & 0 deletions assets/meshes/cube_hex8_8.msh
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
$MeshFormat
4.1 0 8
$EndMeshFormat
$Entities
0 0 0 1
0 0 0 0 1 1 1 0 0
$EndEntities
$Nodes
1 27 1 27
3 0 0 27
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
0 0 0
0.5 0 0
1 0 0
0 0.5 0
0.5 0.5 0
1 0.5 0
0 1 0
0.5 1 0
1 1 0
0 0 0.5
0.5 0 0.5
1 0 0.5
0 0.5 0.5
0.5 0.5 0.5
1 0.5 0.5
0 1 0.5
0.5 1 0.5
1 1 0.5
0 0 1
0.5 0 1
1 0 1
0 0.5 1
0.5 0.5 1
1 0.5 1
0 1 1
0.5 1 1
1 1 1
$EndNodes
$Elements
1 8 1 8
3 0 5 8
1 1 2 5 4 10 11 14 13
2 2 3 6 5 11 12 15 14
3 4 5 8 7 13 14 17 16
4 5 6 9 8 14 15 18 17
5 10 11 14 13 19 20 23 22
6 11 12 15 14 20 21 24 23
7 13 14 17 16 22 23 26 25
8 14 15 18 17 23 24 27 26
$EndElements
Loading