diff --git a/src/FEValues/FacetValues.jl b/src/FEValues/FacetValues.jl index 7d2c6e0d1d..b6512c3b61 100644 --- a/src/FEValues/FacetValues.jl +++ b/src/FEValues/FacetValues.jl @@ -112,21 +112,21 @@ getnormal(fv::FacetValues, qp::Int) = fv.normals[qp] nfacets(fv::FacetValues) = length(fv.geo_mapping) -function set_current_facet!(fv::FacetValues, face_nr::Int) - # Checking face_nr before setting current_facet allows us to use @inbounds +function set_current_facet!(fv::FacetValues, facet_nr::Int) + # Checking facet_nr before setting current_facet allows us to use @inbounds # when indexing by getcurrentfacet(fv) in other places! - checkbounds(Bool, 1:nfacets(fv), face_nr) || throw(ArgumentError("Face index out of range.")) - fv.current_facet = face_nr + checkbounds(Bool, 1:nfacets(fv), facet_nr) || throw(ArgumentError("Facet nr is out of range.")) + fv.current_facet = facet_nr return end -@inline function reinit!(fv::FacetValues, x::AbstractVector, face_nr::Int) - return reinit!(fv, nothing, x, face_nr) +@inline function reinit!(fv::FacetValues, x::AbstractVector, facet_nr::Int) + return reinit!(fv, nothing, x, facet_nr) end -function reinit!(fv::FacetValues, cell::Union{AbstractCell, Nothing}, x::AbstractVector{Vec{dim, T}}, face_nr::Int) where {dim, T} +function reinit!(fv::FacetValues, cell::Union{AbstractCell, Nothing}, x::AbstractVector{Vec{dim, T}}, facet_nr::Int) where {dim, T} check_reinit_sdim_consistency(:FacetValues, shape_gradient_type(fv), eltype(x)) - set_current_facet!(fv, face_nr) + set_current_facet!(fv, facet_nr) n_geom_basefuncs = getngeobasefunctions(fv) if !checkbounds(Bool, x, 1:n_geom_basefuncs) || length(x) != n_geom_basefuncs throw_incompatible_coord_length(length(x), n_geom_basefuncs) @@ -139,11 +139,11 @@ function reinit!(fv::FacetValues, cell::Union{AbstractCell, Nothing}, x::Abstrac throw(ArgumentError("The cell::AbstractCell input is required to reinit! non-identity function mappings")) end - @inbounds for (q_point, w) in pairs(getweights(fv.fqr, face_nr)) + @inbounds for (q_point, w) in pairs(getweights(fv.fqr, facet_nr)) mapping = calculate_mapping(geo_mapping, q_point, x) J = getjacobian(mapping) # See the `Ferrite.embedding_det` docstring for more background - weight_norm = weighted_normal(J, getrefshape(geo_mapping.ip), face_nr) + weight_norm = weighted_normal(J, getrefshape(geo_mapping.ip), facet_nr) detJ = norm(weight_norm) detJ > 0.0 || throw_detJ_not_pos(detJ) @inbounds fv.detJdV[q_point] = detJ * w diff --git a/src/Grid/grid.jl b/src/Grid/grid.jl index 3d27431bd1..c7aa5250bd 100644 --- a/src/Grid/grid.jl +++ b/src/Grid/grid.jl @@ -528,7 +528,7 @@ Returns all nodesets of the `grid`. """ getfacetset(grid::AbstractGrid, setname::String) -Returns all faces as `FacetIndex` in the set with name `setname`. +Returns all facets as `FacetIndex` in the set with name `setname`. """ @inline getfacetset(grid::AbstractGrid, setname::String) = grid.facetsets[setname] """ @@ -648,10 +648,10 @@ for INDEX in (:VertexIndex, :EdgeIndex, :FaceIndex, :FacetIndex) Base.getindex(I::($INDEX), i::Int) = I.idx[i] - #To be able to do a,b = faceidx + #To be able to do, e.g., `a,b = facetidx` Base.iterate(I::($INDEX), state::Int = 1) = (state == 3) ? nothing : (I[state], state + 1) - # Necessary to check if, e.g. `(cellid, faceidx) in faceset` + # Necessary to check if, e.g. `(cellid, facetnr) in facetset` Base.isequal(x::$INDEX, y::$INDEX) = x.idx == y.idx Base.isequal(x::Tuple{Int, Int}, y::$INDEX) = x[1] == y.idx[1] && x[2] == y.idx[2] Base.isequal(y::$INDEX, x::Tuple{Int, Int}) = x[1] == y.idx[1] && x[2] == y.idx[2]