Skip to content

Commit

Permalink
own_and_ghost renamed to split_own_and_ghost
Browse files Browse the repository at this point in the history
  • Loading branch information
JordiManyer committed Aug 31, 2023
1 parent 3faace9 commit dceb819
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/FESpaces.jl
Original file line number Diff line number Diff line change
Expand Up @@ -462,16 +462,16 @@ end

# Factories

function FESpaces.FESpace(model::DistributedDiscreteModel,reffe;own_and_ghost=false,kwargs...)
function FESpaces.FESpace(model::DistributedDiscreteModel,reffe;split_own_and_ghost=false,kwargs...)
spaces = map(local_views(model)) do m
FESpace(m,reffe;kwargs...)
end
gids = generate_gids(model,spaces)
vector_type = _find_vector_type(spaces,gids;own_and_ghost=own_and_ghost)
vector_type = _find_vector_type(spaces,gids;split_own_and_ghost=split_own_and_ghost)
DistributedSingleFieldFESpace(spaces,gids,vector_type)
end

function FESpaces.FESpace(_trian::DistributedTriangulation,reffe;own_and_ghost=false,kwargs...)
function FESpaces.FESpace(_trian::DistributedTriangulation,reffe;split_own_and_ghost=false,kwargs...)
trian = add_ghost_cells(_trian)
trian_gids = generate_cell_gids(trian)
spaces = map(trian.trians) do t
Expand All @@ -480,15 +480,15 @@ function FESpaces.FESpace(_trian::DistributedTriangulation,reffe;own_and_ghost=f
cell_to_ldofs = map(get_cell_dof_ids,spaces)
nldofs = map(num_free_dofs,spaces)
gids = generate_gids(trian_gids,cell_to_ldofs,nldofs)
vector_type = _find_vector_type(spaces,gids;own_and_ghost=own_and_ghost)
vector_type = _find_vector_type(spaces,gids;split_own_and_ghost=split_own_and_ghost)
DistributedSingleFieldFESpace(spaces,gids,vector_type)
end

function _find_vector_type(spaces,gids;own_and_ghost=false)
function _find_vector_type(spaces,gids;split_own_and_ghost=false)
local_vector_type = get_vector_type(PartitionedArrays.getany(spaces))
Tv = eltype(local_vector_type)
T = Vector{Tv}
if own_and_ghost
if split_own_and_ghost
T = OwnAndGhostVectors{T}
end
if isa(gids,PRange)
Expand Down
4 changes: 2 additions & 2 deletions src/MultiField.jl
Original file line number Diff line number Diff line change
Expand Up @@ -236,15 +236,15 @@ end
# Factory

function MultiField.MultiFieldFESpace(
f_dspace::Vector{<:DistributedSingleFieldFESpace};own_and_ghost=false, kwargs...)
f_dspace::Vector{<:DistributedSingleFieldFESpace};split_own_and_ghost=false, kwargs...)
f_p_space = map(local_views,f_dspace)
v(x...) = collect(x)

p_f_space = map(v,f_p_space...)
p_mspace = map(f->MultiFieldFESpace(f;kwargs...),p_f_space)
style = PartitionedArrays.getany(map(MultiFieldStyle,p_mspace))
gids = generate_multi_field_gids(style,f_dspace,p_mspace)
vector_type = _find_vector_type(p_mspace,gids;own_and_ghost=own_and_ghost)
vector_type = _find_vector_type(p_mspace,gids;split_own_and_ghost=split_own_and_ghost)
DistributedMultiFieldFESpace(f_dspace,p_mspace,gids,vector_type)
end

Expand Down

0 comments on commit dceb819

Please sign in to comment.