Skip to content

Commit

Permalink
adding redistribute flags and adaptive weights
Browse files Browse the repository at this point in the history
  • Loading branch information
pmartorell committed Aug 1, 2024
1 parent d579786 commit 781ab9a
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions src/Distributed/DistributedDiscretizations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -339,3 +339,56 @@ function remove_ghost_subfacets(cut::EmbeddedFacetDiscretization,facet_gids)
cut.oid_to_ls,
cut.geo)
end

function compute_redistribute_wights(
cut::DistributedEmbeddedDiscretization,
args...)

geo = get_geometry(cut)
compute_redistribute_wights(cut,geo,args...)
end

function compute_redistribute_wights(
cut::DistributedEmbeddedDiscretization,
geo::CSG.Geometry,
args...)

compute_redistribute_wights(compute_bgcell_to_inoutcut(cut,geo),args...)
end

function compute_redistribute_wights(cell_to_inoutcut,in_or_out=IN)
map(cell_to_inoutcut) do cell_to_inoutcut
map(cell_to_inoutcut) do inoutcut
Int( inoutcut (CUT,in_or_out) )
end
end
end

function compute_adaptive_flags(
cut::DistributedEmbeddedDiscretization,
args...)

geo = get_geometry(cut)
compute_adaptive_flags(cut,geo,args...)
end

function compute_adaptive_flags(
cut::DistributedEmbeddedDiscretization,
geo::CSG.Geometry,
args...)

compute_adaptive_flags(compute_bgcell_to_inoutcut(cut,geo),args...)
end

function compute_adaptive_flags(cell_to_inoutcut)
map(cell_to_inoutcut) do c_to_ioc
flags = zeros(Cint,length(c_to_ioc))
flags .= nothing_flag
for (c,ioc) in enumerate(c_to_ioc)
if ioc == CUT
flags[c] = refine_flag
end
end
flags
end
end

0 comments on commit 781ab9a

Please sign in to comment.