Skip to content

Commit d20dc45

Browse files
committed
Mino
1 parent 828d46b commit d20dc45

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

docs/src/devnotes/distributed-agfem.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Once we have our patches, the question is how we distribute the ownership of the
3131
Some preliminary observations:
3232

3333
- The ConstrainedFESpace eliminates the slave DoFs before assembly. That is during assembly all the cell contributions on a patch get assembled to the master DoFs, i.e the DoFs on the root cell. This means that all slave DoFs of a patch de-facto belong to the same processor as the master DoFs they are tied to.
34-
- We can easily create a patch-conforming cell-partition, where cells are owned by the owner of the patch they belong to. The owner of the patch is taken as the owner of the root cell in the original cell-partition. This new partition does NOT require any communication. It is just a re-partitioning of the local cells with a processor.
34+
- We can easily create a patch-conforming cell-partition, where cells are owned by the owner of the patch they belong to. The owner of the patch is taken as the owner of the root cell in the original cell-partition. This new partition does NOT require any communication. It is just a re-partitioning of the local cells within a processor.
3535
- Something I don't know, but should be possible and even required for this to work is that local DoFs can be constrained by DoFs that do not belong to the original space. TODO: Check this.
3636

3737
Given the above, this is how we can create the DoF constraints:

test/dev/distributed_aggregation.jl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ function exchange_impl!(vector_partition,cache)
3232
buffer_snd = map(vector_partition,cache) do values, cache
3333
local_indices_snd = cache.local_indices_snd
3434
for (p,lid) in enumerate(local_indices_snd.data)
35-
cache.buffer_snd.data[p] = values[lid]
35+
cache.buffer_snd.data[p] = values[lid]
3636
end
3737
cache.buffer_snd
3838
end
3939
neighbors_snd, neighbors_rcv, buffer_rcv = map(cache) do cache
40-
cache.neighbors_snd, cache.neighbors_rcv, cache.buffer_rcv
40+
cache.neighbors_snd, cache.neighbors_rcv, cache.buffer_rcv
4141
end |> tuple_of_arrays
4242
graph = ExchangeGraph(neighbors_snd,neighbors_rcv)
4343
t = exchange!(buffer_rcv,buffer_snd,graph)
@@ -104,6 +104,7 @@ lcell_to_value = map(local_views(bgmodel),lcell_to_lroot) do bgmodel, lcell_to_l
104104
end
105105
return lcell_to_value
106106
end
107+
lcell_to_value_copy = map(copy,lcell_to_value)
107108

108109
# This can also be done in place, but we duplicate infor for now
109110
lcell_to_root = map(lcell_to_lroot,cell_indices) do lcell_to_lroot, cell_indices
@@ -135,3 +136,9 @@ writevtk(
135136
celldata = ["aggregate" => ocell_to_root, "local_aggregates" => ocell_to_lroot],
136137
);
137138

139+
map(ranks,local_views(bgmodel),lcell_to_lroot,lcell_to_value_copy) do r,bgmodel, lcell_to_lroot, lcell_to_value
140+
writevtk(
141+
Triangulation(bgmodel), "data/dumbell_aggregates_$(r)",
142+
celldata = ["values" => lcell_to_value, "roots" => lcell_to_lroot],
143+
);
144+
end

0 commit comments

Comments
 (0)