Skip to content

Commit

Permalink
Using interpolation instead of rand() to generate error indicators in
Browse files Browse the repository at this point in the history
the test
  • Loading branch information
amartinhuertas committed Sep 22, 2023
1 parent cb75e9d commit 4177534
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions test/AdaptivityFlagsMarkingStrategiesTests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,25 @@ module AdaptivityFlagsMarkingStrategiesTests
refinement_fraction=0.2
coarsening_fraction=0.05
cell_partition = get_cell_gids(dmodel)
error_indicators = map(ranks,partition(cell_partition)) do rank, partition
rand(local_length(partition))

degree = 2*order+1
reffe=ReferenceFE(lagrangian,Float64,order)

Vh=FESpace(dmodel,reffe,conformity=:H1)
Uh=TrialFESpace(Vh)
g(x) = sin*(x[1]+x[2]))
gh=interpolate(g,Uh)
Ω = Triangulation(with_ghost,dmodel)
= Measure(Ω,degree)
dc=(g-gh)dΩ
error_indicators=map(local_views(dc)) do dc
get_array(dc)
end

# error_indicators = map(ranks,partition(cell_partition)) do rank, partition
# rand(local_length(partition))
# end

ref_coarse_flags=map(ranks,partition(get_cell_gids(dmodel.dmodel))) do rank,indices
flags=zeros(Cint,length(indices))
flags.=nothing_flag
Expand Down Expand Up @@ -71,7 +86,7 @@ module AdaptivityFlagsMarkingStrategiesTests
dmodel=OctreeDistributedDiscreteModel(ranks,coarse_model,2)
dmodel=test_refine_and_coarsen_at_once(ranks,dmodel,order)
# rdmodel=dmodel
for i=1:5
for i=1:3
dmodel=test_refine_and_coarsen_at_once(ranks,dmodel,order)
end
end
Expand Down

0 comments on commit 4177534

Please sign in to comment.