From 781ab9a1dac62f526a56b24baeb7175ed94e2de0 Mon Sep 17 00:00:00 2001 From: Pere Antoni Martorell Date: Thu, 1 Aug 2024 13:57:28 +0200 Subject: [PATCH 1/6] adding redistribute flags and adaptive weights --- src/Distributed/DistributedDiscretizations.jl | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/src/Distributed/DistributedDiscretizations.jl b/src/Distributed/DistributedDiscretizations.jl index 6e42bc6..08816f3 100644 --- a/src/Distributed/DistributedDiscretizations.jl +++ b/src/Distributed/DistributedDiscretizations.jl @@ -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 From 1185b7d7e578848fd262151c06c8e9c34813eee6 Mon Sep 17 00:00:00 2001 From: Pere Antoni Martorell Date: Thu, 1 Aug 2024 14:06:54 +0200 Subject: [PATCH 2/6] edit news --- NEWS.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/NEWS.md b/NEWS.md index 66e2319..53030e6 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,13 @@ 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). +## [Unreleased] + +### 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). + + ## [0.9.4] - 2024-07-09 ### Added From 969d173d426dceaac7c079bc245bddbaa6a83599 Mon Sep 17 00:00:00 2001 From: Eric Neiva Date: Fri, 18 Oct 2024 07:46:32 +0200 Subject: [PATCH 3/6] Bump new Algoim version --- Project.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 5ccc378..2df2928 100644 --- a/Project.toml +++ b/Project.toml @@ -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" From d0b2a9341ab95c9a96a24856a6772abc95965904 Mon Sep 17 00:00:00 2001 From: Eric Neiva Date: Fri, 18 Oct 2024 07:48:39 +0200 Subject: [PATCH 4/6] Update NEWS.md --- NEWS.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 53030e6..875cf8d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,12 +4,15 @@ 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). -## [Unreleased] +## [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 [#96](https://github.com/gridap/GridapEmbedded.jl/pull/96). ## [0.9.4] - 2024-07-09 From 03e11c8ff091210c4f0b672538b42d8c5d40d64c Mon Sep 17 00:00:00 2001 From: Eric Neiva Date: Fri, 18 Oct 2024 07:49:36 +0200 Subject: [PATCH 5/6] New GE 0.9.5 --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 2df2928..0890358 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "GridapEmbedded" uuid = "8838a6a3-0006-4405-b874-385995508d5d" authors = ["Francesc Verdugo ", "Eric Neiva ", "Pere Antoni Martorell ", "Santiago Badia "] -version = "0.9.4" +version = "0.9.5" [deps] AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c" From ca1256a2cbebd70d25797b18bd344385c1a8dc0f Mon Sep 17 00:00:00 2001 From: Eric Neiva Date: Fri, 18 Oct 2024 07:51:37 +0200 Subject: [PATCH 6/6] Update NEWS.md [skip ci] --- NEWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 875cf8d..bb65c90 100644 --- a/NEWS.md +++ b/NEWS.md @@ -12,7 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- Updated to Algoim v0.2.2, which runs on Julia 1.11. Since PR [#96](https://github.com/gridap/GridapEmbedded.jl/pull/96). +- 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