diff --git a/src/Geometry.jl b/src/Geometry.jl index 4c78824..517dd59 100644 --- a/src/Geometry.jl +++ b/src/Geometry.jl @@ -491,11 +491,21 @@ function Geometry.BoundaryTriangulation( BoundaryTriangulation(no_ghost,model;kwargs...) end +function Geometry.BoundaryTriangulation( + trian::DistributedTriangulation;kwargs...) + BoundaryTriangulation(no_ghost,trian;kwargs...) +end + function Geometry.SkeletonTriangulation( model::DistributedDiscreteModel;kwargs...) SkeletonTriangulation(no_ghost,model;kwargs...) end +function Geometry.SkeletonTriangulation( + trian::DistributedTriangulation;kwargs...) + SkeletonTriangulation(no_ghost,trian;kwargs...) +end + function Geometry.Triangulation( portion,::Type{ReferenceFE{Dt}},model::DistributedDiscreteModel{Dm};kwargs...) where {Dt,Dm} # Generate global ordering for the faces of dimension Dt (if needed) @@ -515,6 +525,17 @@ function Geometry.BoundaryTriangulation( DistributedTriangulation(trians,model) end +function Geometry.BoundaryTriangulation( + portion,trian::DistributedTriangulation;kwargs... +) + model = get_background_model(trian) + gids = get_cell_gids(model) + trians = map(local_views(trian),partition(gids)) do trian, gids + BoundaryTriangulation(portion,gids,trian;kwargs...) + end + DistributedTriangulation(trians,model) +end + function Geometry.SkeletonTriangulation( portion,model::DistributedDiscreteModel{Dc};kwargs...) where Dc gids = get_face_gids(model,Dc) @@ -524,6 +545,17 @@ function Geometry.SkeletonTriangulation( DistributedTriangulation(trians,model) end +function Geometry.SkeletonTriangulation( + portion,trian::DistributedTriangulation;kwargs... +) + model = get_background_model(trian) + gids = get_cell_gids(model) + trians = map(local_views(trian),partition(gids)) do trian, gids + SkeletonTriangulation(portion,gids,trian;kwargs...) + end + DistributedTriangulation(trians,model) +end + function Geometry.Triangulation( portion,gids::AbstractLocalIndices, args...;kwargs...) trian = Triangulation(args...;kwargs...) diff --git a/test/GeometryTests.jl b/test/GeometryTests.jl index beeae4d..9c51068 100644 --- a/test/GeometryTests.jl +++ b/test/GeometryTests.jl @@ -92,14 +92,21 @@ function main(distribute,parts) add_tag!(labels,"fluid",[fluid]) cell_to_entity end - cell_gids=get_cell_gids(model) - vcache=PartitionedArrays.p_vector_cache(cell_to_entity,partition(cell_gids)) - assemble!((a,b)->b, cell_to_entity, map(reverse,vcache) ) |> wait # Make tags consistent + cell_gids = get_cell_gids(model) + consistent!(PVector(cell_to_entity,partition(cell_gids))) |> wait # Make tags consistent + #vcache = PartitionedArrays.p_vector_cache(cell_to_entity,partition(cell_gids)) + #assemble!((a,b)->b, cell_to_entity, map(reverse,vcache) ) |> wait # Make tags consistent Ωs = Interior(model,tags="solid") Ωf = Interior(model,tags="fluid") Γfs = Interface(Ωf,Ωs) + # CompositeTriangulations + Γf = Boundary(Ωf) + Λf = Skeleton(Ωf) + Λs = Skeleton(Ωs) + Γs = Boundary(Ωs) + end function test_local_part_face_labelings_consistency(lmodel::CartesianDiscreteModel{D},gids,gmodel) where {D}