You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The GeometryMapping in #764 should be reusable in BCValues. To avoid littering that PR with even more stuff, I'm leaving some preliminary and untested code here as a reference.
To be done in a separate PR after merging 764...
""" BCValues(func_interpol::Interpolation, geom_interpol::Interpolation, boundary_type::Union{Type{<:BoundaryIndex}})`BCValues` stores the shape values at all faces/edges/vertices (depending on `boundary_type`) for the geometric interpolation (`geom_interpol`),for each dof-position determined by the `func_interpol`. Used mainly by the `ConstraintHandler`."""struct BCValues{V_GM, FQR} <:AbstractFaceValues
geo_mapping::V_GM# AbstractVector{GeometryMapping}
fqr::FQR# FaceQuadratureRule
current_face::ScalarWrapper{Int}endBCValues(func_interpol::Interpolation, geom_interpol::Interpolation, boundary_type::Type{<:BoundaryIndex}= Ferrite.FaceIndex) =BCValues(Float64, func_interpol, geom_interpol, boundary_type)
functionBCValues(::Type{T}, func_interpol::Interpolation{refshape}, geom_interpol::Interpolation{refshape}, boundary_type::Type{<:BoundaryIndex}= Ferrite.FaceIndex) where {T,dim,refshape <:AbstractRefShape{dim}}
# set up quadrature rules for each boundary entity with dof-positions# (determined by func_interpol) as the quadrature points
interpolation_coords =reference_coordinates(func_interpol)
qrs = QuadratureRule{refshape,T,dim}[]
for boundarydofs indirichlet_boundarydof_indices(boundary_type)(func_interpol)
dofcoords = Vec{dim,T}[]
for boundarydof in boundarydofs
push!(dofcoords, interpolation_coords[boundarydof])
end
qrf =QuadratureRule{refshape,T}(fill(T(NaN), length(dofcoords)), dofcoords) # weights will not be usedpush!(qrs, qrf)
end
fqr =FaceQuadratureRule(qrs)
geo_mapping = [GeometryMapping{0}(T, geom_interpol, qr) for qr in qrs]
BCValues(geo_mapping, fqr, ScalarWrapper(1))
endnfaces(bcv::BCValues) =length(bcv.geo_mapping)
getcurrentface(bcv) = bcv.current_face[]
functionset_current_face!(bcv::BCValues, face_nr::Int)
# Checking face_nr before setting current_face allows us to use @inbounds # when indexing by getcurrentface(fv) in other places!checkbounds(Bool, 1:nfaces(bcv), face_nr) ||throw(ArgumentError("Face index out of range."))
bcv.current_face[] = face_nr
endgetnquadpoints(bcv::BCValues) =@inboundsgetnquadpoints(bcv.fqr, getcurrentface(bcv))
The text was updated successfully, but these errors were encountered:
The
GeometryMapping
in #764 should be reusable inBCValues
. To avoid littering that PR with even more stuff, I'm leaving some preliminary and untested code here as a reference.To be done in a separate PR after merging 764...
The text was updated successfully, but these errors were encountered: