1
1
2
+ const D2= 2
2
3
const D3= 3
3
4
const POINT= 15
4
5
const UNSET = 0
74
75
75
76
function _setup_grid (gmsh,Dc,Dp,node_to_coords,node_to_vertex)
76
77
77
- if Dp == 3 && Dc == 2
78
+ if ( Dp == 3 && Dc == 2 ) || ( Dp == 2 && Dc == 1 )
78
79
orient_if_simplex = false
79
80
else
80
81
orient_if_simplex = true
@@ -85,7 +86,7 @@ function _setup_grid(gmsh,Dc,Dp,node_to_coords,node_to_vertex)
85
86
cell_to_entity = _setup_cell_to_entity (
86
87
gmsh,Dc,length (cell_to_nodes),nminD)
87
88
88
- if Dp == 3 && Dc == 2
89
+ if ( Dp == 3 && Dc == 2 ) || ( Dp == 2 && Dc == 1 )
89
90
cell_coords = lazy_map (Broadcasting (Reindex (node_to_coords)),cell_to_nodes)
90
91
ctype_shapefuns = map (get_shapefuns,reffes)
91
92
cell_shapefuns = expand_cell_data (ctype_shapefuns,cell_to_type)
@@ -112,6 +113,13 @@ function _setup_grid(gmsh,Dc,Dp,node_to_coords,node_to_vertex)
112
113
113
114
end
114
115
116
+ function _unit_outward_normal (v:: MultiValue{Tuple{1,2}} )
117
+ n1 = v[1 ,2 ]
118
+ n2 = - v[1 ,1 ]
119
+ n = VectorValue (n1,n2)
120
+ n/ norm (n)
121
+ end
122
+
115
123
function _unit_outward_normal (v:: MultiValue{Tuple{2,3}} )
116
124
n1 = v[1 ,2 ]* v[2 ,3 ] - v[1 ,3 ]* v[2 ,2 ]
117
125
n2 = v[1 ,3 ]* v[2 ,1 ] - v[1 ,1 ]* v[2 ,3 ]
@@ -199,14 +207,20 @@ function _setup_point_dim(gmsh,Dc)
199
207
return Dc
200
208
end
201
209
nodeTags, coord, parametricCoord = gmsh. model. mesh. getNodes ()
202
- for node in nodeTags
203
- j = D3
204
- k = (node- 1 )* D3 + j
205
- xj = coord[k]
206
- if ! (xj + 1 ≈ 1 )
210
+ for node in nodeTags # Search a non-zero z-coordinate
211
+ k = (node- 1 )* D3 + D3
212
+ xk = coord[k]
213
+ if ! (xk + 1 ≈ 1 )
207
214
return D3
208
215
end
209
216
end
217
+ for node in nodeTags # Search a non-zero y-coordinate
218
+ j = (node- 1 )* D3 + D2
219
+ xj = coord[j]
220
+ if ! (xj + 1 ≈ 1 )
221
+ return D2
222
+ end
223
+ end
210
224
Dc
211
225
end
212
226
0 commit comments