Skip to content

Commit

Permalink
Remove explicit documention of fields in CellCache (#1079)
Browse files Browse the repository at this point in the history
  • Loading branch information
KnutAM authored Sep 28, 2024
1 parent 4b8c233 commit 225a016
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 16 deletions.
2 changes: 1 addition & 1 deletion docs/src/literate-tutorials/incompressible_elasticity.jl
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ function compute_stresses(cellvalues_u::CellValues, cellvalues_p::CellValues,
reinit!(cellvalues_u, cc)
reinit!(cellvalues_p, cc)
## Extract the cell local part of the solution
for (i, I) in pairs(cc.dofs)
for (i, I) in pairs(celldofs(cc))
ae[i] = a[I]
end
## Loop over the quadrature points
Expand Down
6 changes: 3 additions & 3 deletions docs/src/literate-tutorials/stokes-flow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -447,8 +447,8 @@ function check_mean_constraint(dh, fvp, u) #src
∫pdΓ, Γ= 0.0, 0.0 #src
for (ci, fi) in set #src
reinit!(cc, ci) #src
reinit!(fvp, cc.coords, fi) #src
ue = u[cc.dofs] #src
reinit!(fvp, cc, fi) #src
ue = u[celldofs(cc)] #src
for qp in 1:getnquadpoints(fvp) #src
= getdetJdV(fvp, qp) #src
∫pdΓ += function_value(fvp, qp, ue, range_p) *#src
Expand All @@ -466,7 +466,7 @@ function check_L2(dh, cvu, cvp, u) #src
for cell in CellIterator(dh) #src
reinit!(cvu, cell) #src
reinit!(cvp, cell) #src
ue = u[cell.dofs] #src
ue = u[celldofs(cell)] #src
for qp in 1:getnquadpoints(cvu) #src
= getdetJdV(cvu, qp) #src
uh = function_value(cvu, qp, ue, range_u) #src
Expand Down
14 changes: 2 additions & 12 deletions src/iterators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ Create a cache object with pre-allocated memory for the nodes, coordinates, and
cell. The cache is updated for a new cell by calling `reinit!(cache, cellid)` where
`cellid::Int` is the cell id.
**Struct fields of `CellCache`**
- `cc.nodes :: Vector{Int}`: global node ids
- `cc.coords :: Vector{<:Vec}`: node coordinates
- `cc.dofs :: Vector{Int}`: global dof ids (empty when constructing the cache from a grid)
**Methods with `CellCache`**
- `reinit!(cc, i)`: reinitialize the cache for cell `i`
- `cellid(cc)`: get the cell id of the currently cached cell
Expand Down Expand Up @@ -105,10 +100,6 @@ celldofs!(v::Vector, cc::CellCache) = copyto!(v, cc.dofs) # celldofs!(v, cc.dh,
nfacets(cc::CellCache) = nfacets(getcells(cc.grid, cc.cellid))


# TODO: Currently excluded from the docstring below. Should they be public?
# - `Ferrite.faceindex(fc)`: get the `FaceIndex` of the currently cached face
# - `Ferrite.faceid(fc)`: get the current faceid (`faceindex(fc)[2]`)

"""
FacetCache(grid::Grid)
FacetCache(dh::AbstractDofHandler)
Expand All @@ -119,7 +110,7 @@ calling `reinit!(cache, fi::FacetIndex)`.
**Methods with `fc::FacetCache`**
- `reinit!(fc, fi)`: reinitialize the cache for face `fi::FacetIndex`
- `cellid(fc)`: get the current cellid (`faceindex(fc)[1]`)
- `cellid(fc)`: get the current cellid
- `getnodes(fc)`: get the global node ids of the *cell*
- `getcoordinates(fc)`: get the coordinates of the *cell*
- `celldofs(fc)`: get the global dof ids of the *cell*
Expand Down Expand Up @@ -152,9 +143,8 @@ for op = (:getnodes, :getcoordinates, :cellid, :celldofs)
end
end
end
# @inline faceid(fc::FacetCache) = fc.current_faceid[]

@inline celldofs!(v::Vector, fc::FacetCache) = celldofs!(v, fc.cc)
# @inline faceindex(fc::FacetCache) = FaceIndex(cellid(fc), faceid(fc))
@inline function reinit!(fv::FacetValues, fc::FacetCache)
reinit!(fv, fc.cc, fc.current_facet_id)
end
Expand Down

0 comments on commit 225a016

Please sign in to comment.