-
Notifications
You must be signed in to change notification settings - Fork 15
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
Bulk penalty stab div #102
base: bulk_penalty_stab
Are you sure you want to change the base?
Conversation
…st_agg_cells_rhs_contribs). Fix with rank does not seem to work.
…as this has been fixed by changing the BulkGhostPenaltyAssembleRhsMap.
What I said is, take a function u_ex such that div(u_ex) in Q_BB And check that the stab term is zero E.g, u = (x,y), its div(u) is a constant Then, you must get zero
…h behaviour, i.e., with u_ex and p_ex in FE spaces, eps for both; if only uex in FE space, eps only for u.
…nged in the canvas
…RT: allow function g to be passed along.
…ted to going from nint2 to nint3 (TEST0 )
TEST0-cutsquare-nint3.jl
Outdated
### STABILIZATION ON Ωagg\Troot ### | ||
########################################### | ||
|
||
## (1) FIND ALL INTERIOR CELLS WHICH ARE NOT PART OF AN AGGREGATE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@amboschman ... I have taken a careful look at the lines below this one till the call to revised_setup_aggregate_to_cut_cells
. I think I also got what the issue/bug with your original setup_aggregate_to_cut_cells
was. At the end of the day, you need to generate an array with the root_cells
and an array with the cut_cells
in the very same order you have them listed in aggregate_to_cells
In any case, I think there is a better (more general and more efficient) way to do the very same thing. I copy and paste the code that implements this alternative way below:
# Set up bg_cell_type
# -1: exterior
# 0: cut
# 1: interior, non root
# >1: interior root
# TO-DO: pack this for loop in a function `set_up_cell_type`
cell_type = zeros(Int64,length(aggregates))
for (pos,val) in enumerate(aggregates)
if val==0
cell_type[pos]=-1
else
cell_type[val]+=1
end
end
cell_is_exterior(cell)=cell_type[cell]==-1
cell_is_cut(cell)=cell_type[cell]==0
cell_is_interior_root(cell)=cell_type[cell]>1
cell_is_interior_non_root(cell)=cell_type[cell]==1
function flatten(array_of_arrays)
vcat(array_of_arrays...)
end
function restrict_to_cell_type(aggregate_to_cells, cell_type_filter)
ret=Vector{Int}[]
for agg in aggregate_to_cells
new_agg=Int64[]
for cell in agg
if cell_type_filter(cell)
push!(new_agg, cell)
end
end
push!(ret, new_agg)
end
ret
end
With this machinery, you can compute root_cells
, cut_cells
and aggregate_to_cut_cells
in a unified way as:
root_cells = flatten(restrict_to_cell_type(aggregate_to_cells,cell_is_interior_root))
aggregate_to_cut_cells = restrict_to_cell_type(aggregate_to_cells,cell_is_cut))
cut_cells = flatten(aggregate_to_cut_cells)
Let me know if that makes sense.
…tion, 2=darcy problem) in single canvas
…ed as function when collecting the dmix stabilization terms
… cells, e.g. cut,interior, exterior.
…lect stabilization contributions
@amboschman ... Mostly creating this PR so that I can add comments to the code
not to be merged YET .... WIP