Skip to content

Commit

Permalink
Added comments
Browse files Browse the repository at this point in the history
  • Loading branch information
JordiManyer committed Aug 25, 2024
1 parent b6e61a6 commit 67484de
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/Adaptivity/RefinementRules.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ struct RefinementRule{P}
end

# Note for devs:
# The reason why we are saving both the cell maps and the inverse cell maps is to avoid recomputing
# them when needed. This is needed for performance when the RefinementRule is used for MacroFEs.
# Also, in the case the ref_grid comes from a CartesianGrid, we save the cell maps as
# AffineMaps, which are more efficient than the default linear_combinations.
# - The reason why we are saving both the cell maps and the inverse cell maps is to avoid recomputing
# them when needed. This is needed for performance when the RefinementRule is used for MacroFEs.
# Also, in the case the ref_grid comes from a CartesianGrid, we save the cell maps as
# AffineMaps, which are more efficient than the default linear_combinations.
# - We cannot parametrise the RefinementRule by all it's fields, because we will have different types of
# RefinementRules in a single mesh. It's the same reason why we don't parametrise the ReferenceFE type.

function RefinementRule(
T::RefinementRuleType,poly::Polytope,ref_grid::DiscreteModel;
Expand Down Expand Up @@ -69,7 +71,7 @@ function RefinementRule(poly::Polytope{D},partition::NTuple{D,Integer};kwargs...
return RefinementRule(GenericRefinement(),poly,ref_grid;kwargs...)
end

function Base.show(io::IO,rr::RefinementRule{P,A}) where {P,A}
function Base.show(io::IO,rr::RefinementRule{P}) where P
T = RefinementRuleType(rr)
print(io,"RefinementRule{$(rr.poly),$T}")
end
Expand Down

0 comments on commit 67484de

Please sign in to comment.