Skip to content

Commit

Permalink
Merge pull request #2 from gridap/master
Browse files Browse the repository at this point in the history
Merge into branch
  • Loading branch information
zjwegert authored Oct 20, 2024
2 parents 9cabe09 + 100ec34 commit 629f195
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 3 deletions.
10 changes: 10 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.9.5] - 2024-10-18

### Added

- Adding `compute_redistribute_weights` and `compute_adaptive_flags` functions for load balancing and adaptive mesh refinement, respectively. Since PR [#95](https://github.com/gridap/GridapEmbedded.jl/pull/95).

### Changed

- Updated to Algoim v0.2.2, which runs on Julia 1.11. Since PR [#97](https://github.com/gridap/GridapEmbedded.jl/pull/97).

## [0.9.4] - 2024-07-09

### Added
Expand Down
6 changes: 3 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "GridapEmbedded"
uuid = "8838a6a3-0006-4405-b874-385995508d5d"
authors = ["Francesc Verdugo <[email protected]>", "Eric Neiva <[email protected]>", "Pere Antoni Martorell <[email protected]>", "Santiago Badia <[email protected]>"]
version = "0.9.4"
version = "0.9.5"

[deps]
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
Expand All @@ -22,9 +22,9 @@ algoimWrapper_jll = "3c43aa7b-5398-51f3-8d75-8f051e6faa4d"

[compat]
AbstractTrees = "0.3.3, 0.4"
Algoim = "0.2"
Algoim = "0.2.2"
Combinatorics = "1"
CxxWrap = "0.14"
CxxWrap = "0.16"
FillArrays = "0.10, 0.11, 0.12, 0.13, 1"
Gridap = "0.17, 0.18"
GridapDistributed = "0.3, 0.4"
Expand Down
53 changes: 53 additions & 0 deletions src/Distributed/DistributedDiscretizations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -343,3 +343,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 629f195

Please sign in to comment.