diff --git a/src/boundary_utils.jl b/src/boundary_utils.jl index 73656d4d..552121ab 100644 --- a/src/boundary_utils.jl +++ b/src/boundary_utils.jl @@ -2,7 +2,7 @@ function coordinate_face_centroids(xf, md) Nfaces = size(md.FToF, 1) Nfp = size(md.xf, 1) ÷ Nfaces - xc = reshape(xf, Nfp, Nfaces * md.K) + xc = reshape(xf, Nfp, :) return vec(typeof(xf)(sum(xc, dims=1) / size(xc, 1))) end @@ -12,7 +12,7 @@ end Returns face centroids and `boundary_face_ids` on the boundaries of the domain given by md::MeshData. """ function boundary_face_centroids(md) - compute_face_centroids(md) = map(x->coordinate_face_centroids(x, md), md.xyzf) + compute_face_centroids(md) = map(x -> coordinate_face_centroids(x, md), md.xyzf) xyzc = compute_face_centroids(md) boundary_face_ids = findall(vec(md.FToF) .== 1:length(md.FToF)) diff --git a/src/connectivity_functions.jl b/src/connectivity_functions.jl index 1c36af58..0a9f18bb 100644 --- a/src/connectivity_functions.jl +++ b/src/connectivity_functions.jl @@ -77,19 +77,18 @@ julia> mapM, mapP, mapB = build_node_maps(FToF, (xf, yf)) ``` """ function build_node_maps(FToF, Xf; tol = 100 * eps()) - - # total number of faces - num_faces_total = length(FToF) + + num_faces_total = length(FToF) # num face points: assumes all faces have the same number of nodes num_nodes_per_face = length(Xf[1]) ÷ num_faces_total # number nodes consecutively - mapM = reshape(collect(1:length(Xf[1])), num_nodes_per_face, num_faces_total); + mapM = reshape(collect(1:length(Xf[1])), num_nodes_per_face, :); mapP = copy(mapM); # reshape to be a face-first array - Xf = reshape.(Xf, num_nodes_per_face, num_faces_total) + Xf = reshape.(Xf, num_nodes_per_face, :) p = zeros(Int, num_nodes_per_face) for (f1, f2) in enumerate(FToF)