Skip to content

Commit

Permalink
Merge pull request #901 from aerappa/refine_nvb
Browse files Browse the repository at this point in the history
Add newest vertex bisection into new adaptivity framework
  • Loading branch information
amartinhuertas authored May 22, 2023
2 parents 6a0dfdd + 78613f6 commit f28c84a
Show file tree
Hide file tree
Showing 8 changed files with 314 additions and 812 deletions.
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Jacobi polynomial bases. Since PR [#896](https://github.com/gridap/Gridap.jl/pull/896).

- Replaced newest vertex bisection mesh adaptation in
`src/Geometry/NewestVertexBisection.jl` with appropriate changes to
`src/Adaptivity/EdgeBasedRefinement.jl`. see PR
[#901](https://github.com/gridap/Gridap.jl/pull/901).

### Fixed

- ODE operators cache linear system at initial time or the time stored by the operator. Before, the linear system was cached at time `t = 0.0`, which cannot be done if the operator is not well-defined at `t = 0.0`. Since PR [#891](https://github.com/gridap/Gridap.jl/pull/891).
Expand Down
13 changes: 10 additions & 3 deletions src/Adaptivity/AdaptedDiscreteModels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,15 @@ function refine(model::UnstructuredDiscreteModel,::AdaptivityMethod,args...;kwar
@abstractmethod
end

function refine(model::UnstructuredDiscreteModel,args...;refinement_method=EdgeBasedRefinement(),kwargs...)
return refine(refinement_method,model,args...;kwargs...)
# Handle the user's requested choice for refinement
function string_to_refinement(refinement_method::String, model)
refinement_method == "red_green" && return RedGreenRefinement()
refinement_method == "nvb" && return NVBRefinement(model)
error("refinement_method $refinement_method not recognized")
end

function refine(model::UnstructuredDiscreteModel,args...;refinement_method="red_green",kwargs...)
return refine(string_to_refinement(refinement_method, model),model,args...;kwargs...)
end

# CartesianDiscreteModel refining
Expand Down Expand Up @@ -151,4 +158,4 @@ end

return f2c_map, child_map
end)
end
end
322 changes: 282 additions & 40 deletions src/Adaptivity/EdgeBasedRefinement.jl

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions src/Geometry/Geometry.jl
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ export compute_vertex_node
export get_node_face_owner
export compute_node_face_owner
export get_triangulation
export newest_vertex_bisection

export UnstructuredDiscreteModel
export CartesianDiscreteModel
Expand Down Expand Up @@ -222,8 +221,6 @@ include("GridPortions.jl")

include("DiscreteModelPortions.jl")

include("NewestVertexBisection.jl")

include("Triangulations.jl")

include("BoundaryTriangulations.jl")
Expand Down
Loading

0 comments on commit f28c84a

Please sign in to comment.