Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distributed GridapEmbedded and AgFEM #81

Merged
merged 34 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
8feee5f
setup distributed driver
pmartorell Mar 24, 2023
120981e
remove ghost cells from cut triangulations
pmartorell Mar 27, 2023
722a698
setup consistent dof owner
pmartorell Mar 31, 2023
c4fd428
setup distributed agfem spaces
pmartorell Apr 4, 2023
fbc92af
Add ghosts to touched_ gids
pmartorell Apr 13, 2023
a429792
[Distributed] compute cuts only in own cells - pausing developments
pmartorell Apr 14, 2023
f5eec87
Merge branch 'master' of github.com:gridap/GridapEmbedded.jl into dis…
pmartorell Mar 22, 2024
066eee8
[distributed] upgrade GridapDistributed
pmartorell Mar 22, 2024
27db096
distributed devs to src
pmartorell Apr 3, 2024
507230a
[distributed] deveolping distributed aggregation
pmartorell Apr 4, 2024
0930d94
[distributed] parallel aggregation - to be tested
pmartorell Apr 4, 2024
be66316
testing distributed aggregation
pmartorell Apr 5, 2024
da5d3bf
[distributed] testing root aggregates in ghost layer [✓]
pmartorell Apr 5, 2024
3d678b2
[distributed] add remote aggregates to bgmodel
pmartorell Apr 8, 2024
db1da3c
[distributed] testing remotes on bgmodels (not working)
pmartorell Apr 9, 2024
276389c
[distributed] bugfix and testing remote ghost with no aggregation
pmartorell Apr 10, 2024
1d3332a
[distributed] bugfix in generate agg gids
pmartorell Apr 11, 2024
d30394c
[distributed] cleaning aggregation interface
pmartorell Apr 11, 2024
d41de46
[distributed] structured src
pmartorell Apr 11, 2024
92be5c6
[distribute] unify sequential tests
pmartorell Apr 12, 2024
70a05e2
[distributed] setup mpi tests
pmartorell Apr 12, 2024
b828ea9
[distributed] adding aggregation tests
pmartorell Apr 12, 2024
0c5a261
Merge branch 'master' of github.com:gridap/GridapEmbedded.jl into dis…
pmartorell Apr 12, 2024
e63b612
[distributed] missing file
pmartorell Apr 12, 2024
b93f42f
[debug] try to fix ci error
pmartorell Apr 12, 2024
fac84cb
Merge branch 'master' of github.com:gridap/GridapEmbedded.jl into dis…
pmartorell Apr 15, 2024
d510d2b
[distributed] missing cut_facets interfaces
pmartorell Apr 16, 2024
03931d9
update GridapEmbedded
pmartorell Apr 16, 2024
d43b730
[distributed] Int bug in x86 test
pmartorell Apr 16, 2024
3732bde
[distributed] bugfix
pmartorell Apr 17, 2024
b51524a
[distributed] minor
pmartorell Apr 17, 2024
189f5dd
[distributed] debug ci 32 bit
pmartorell Apr 22, 2024
396df80
[distributed] debug x86
pmartorell Apr 22, 2024
d3e6079
[distributed] do not test distributed with 32-bit machines
pmartorell Apr 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,27 @@ Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
CxxWrap = "1f15a43c-97ca-5a2a-ae31-89f07a497df4"
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"
Gridap = "56d4f2e9-7ea1-5844-9cf6-b9c51ca7ce8e"
GridapDistributed = "f9701e48-63b3-45aa-9a63-9bc6c271f355"
LightGraphs = "093fc24a-ae57-5d10-9952-331d41423f4d"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MPI = "da04e1cc-30fd-572f-bb4f-1f8673147195"
MiniQhull = "978d7f02-9e05-4691-894f-ae31a51d76ca"
PartitionedArrays = "5a9dfac6-5c52-46f7-8278-5e2210713be9"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
algoimWrapper_jll = "3c43aa7b-5398-51f3-8d75-8f051e6faa4d"

[compat]
Algoim = "0.2"
AbstractTrees = "0.3.3, 0.4"
Algoim = "0.2"
Combinatorics = "1"
CxxWrap = "0.14"
FillArrays = "0.10, 0.11, 0.12, 0.13, 1"
GridapDistributed = "0.3, 0.4"
Gridap = "0.17, 0.18"
LightGraphs = "1.3.3"
MiniQhull = "0.1.0, 0.2, 0.3, 0.4"
PartitionedArrays = "0.3.4"
julia = "1.3"

[extras]
Expand Down
29 changes: 21 additions & 8 deletions src/AgFEM/AgFEMSpaces.jl
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@

function AgFEMSpace(f::SingleFieldFESpace,bgcell_to_bgcellin::AbstractVector,g::SingleFieldFESpace=f)
function AgFEMSpace(
f::SingleFieldFESpace,
bgcell_to_bgcellin::AbstractVector,
g::SingleFieldFESpace=f,
args...)

@assert get_triangulation(f) === get_triangulation(g)
AgFEMSpace(f,bgcell_to_bgcellin,get_fe_basis(g),get_fe_dof_basis(g))
AgFEMSpace(f,bgcell_to_bgcellin,get_fe_basis(g),get_fe_dof_basis(g),args...)
end

# Note: cell is in fact bgcell in this function since f will usually be an ExtendedFESpace
function AgFEMSpace(
f::SingleFieldFESpace,
bgcell_to_bgcellin::AbstractVector,
shfns_g::CellField,
dofs_g::CellDof)
dofs_g::CellDof,
bgcell_to_gcell::AbstractVector=1:length(bgcell_to_bgcellin))

# Triangulation made of active cells
trian_a = get_triangulation(f)
Expand All @@ -21,6 +27,7 @@ function AgFEMSpace(
bgcell_to_acell = glue.mface_to_tface
acell_to_bgcellin = lazy_map(Reindex(bgcell_to_bgcellin),acell_to_bgcell)
acell_to_acellin = collect(lazy_map(Reindex(bgcell_to_acell),acell_to_bgcellin))
acell_to_gcell = lazy_map(Reindex(bgcell_to_gcell),acell_to_bgcell)

# Build shape funs of g by replacing local funs in cut cells by the ones at the root
# This needs to be done with shape functions in the physical domain
Expand All @@ -41,7 +48,8 @@ function AgFEMSpace(
acell_to_acellin,
acell_to_dof_ids,
acell_to_coeffs,
acell_to_proj)
acell_to_proj,
acell_to_gcell)

FESpaceWithLinearConstraints(aggdof_to_fdof,aggdof_to_dofs,aggdof_to_coeffs,f)
end
Expand All @@ -51,7 +59,8 @@ function _setup_agfem_constraints(
acell_to_acellin,
acell_to_dof_ids,
acell_to_coeffs,
acell_to_proj)
acell_to_proj,
acell_to_gcell)

n_acells = length(acell_to_acellin)
fdof_to_isagg = fill(true,n_fdofs)
Expand All @@ -62,12 +71,16 @@ function _setup_agfem_constraints(
acellin = acell_to_acellin[acell]
iscut = acell != acellin
dofs = getindex!(cache,acell_to_dof_ids,acell)
gcell = acell_to_gcell[acell]
for (ldof,dof) in enumerate(dofs)
if dof > 0
fdof = dof
fdof_to_isagg[fdof] = iscut && fdof_to_isagg[fdof]
fdof_to_acell[fdof] = acell
fdof_to_ldof[fdof] = ldof
acell_dof = fdof_to_acell[fdof]
if acell_dof == 0 || gcell > acell_to_gcell[acell_dof]
fdof_to_acell[fdof] = acell
fdof_to_isagg[fdof] = iscut && fdof_to_isagg[fdof]
fdof_to_ldof[fdof] = ldof
end
end
end
end
Expand Down
59 changes: 59 additions & 0 deletions src/Distributed/Distributed.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
module Distributed

using Gridap
using GridapDistributed
using PartitionedArrays
using FillArrays

using Gridap.Arrays
using Gridap.CellData
using Gridap.Geometry
using Gridap.Helpers
using Gridap.ReferenceFEs

using GridapEmbedded.CSG
using GridapEmbedded.LevelSetCutters
using GridapEmbedded.Interfaces
using GridapEmbedded.Interfaces: Cutter
using GridapEmbedded.Interfaces: ActiveInOrOut
using GridapEmbedded.Interfaces: SubFacetTriangulation
using GridapEmbedded.Interfaces: SubCellData
using GridapEmbedded.Interfaces: SubFacetData
using GridapEmbedded.Interfaces: AbstractEmbeddedDiscretization
using GridapEmbedded.AgFEM: _touch_aggregated_cells!
using GridapEmbedded.AgFEM: AggregateCutCellsByThreshold
using GridapEmbedded.MomentFittedQuadratures: MomentFitted
using Gridap.Geometry: AppendedTriangulation
using Gridap.Geometry: get_face_to_parent_face
using GridapDistributed: DistributedDiscreteModel
using GridapDistributed: DistributedTriangulation
using GridapDistributed: DistributedFESpace
using GridapDistributed: DistributedSingleFieldFESpace
using GridapDistributed: DistributedMeasure
using GridapDistributed: add_ghost_cells
using GridapDistributed: generate_gids
using GridapDistributed: generate_cell_gids
using GridapDistributed: _find_vector_type

import GridapEmbedded.AgFEM: aggregate
import GridapEmbedded.AgFEM: AgFEMSpace
import GridapEmbedded.Interfaces: cut
import GridapEmbedded.Interfaces: cut_facets
import GridapEmbedded.Interfaces: EmbeddedBoundary
import GridapEmbedded.Interfaces: compute_bgfacet_to_inoutcut
import GridapEmbedded.Interfaces: compute_bgcell_to_inoutcut
import GridapEmbedded.CSG: get_geometry
import Gridap.Geometry: Triangulation
import Gridap.Geometry: SkeletonTriangulation
import Gridap.Geometry: BoundaryTriangulation
import Gridap.Geometry: get_background_model
import GridapDistributed: local_views
import GridapDistributed: remove_ghost_cells

include("DistributedDiscretizations.jl")

include("DistributedAgFEM.jl")

include("DistributedQuadratures.jl")

end # module
Loading
Loading