From 41775344ab876b452e2c9426808e7df4325773b2 Mon Sep 17 00:00:00 2001 From: "Alberto F. Martin" Date: Sat, 23 Sep 2023 09:49:57 +1000 Subject: [PATCH] Using interpolation instead of rand() to generate error indicators in the test --- test/AdaptivityFlagsMarkingStrategiesTests.jl | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/test/AdaptivityFlagsMarkingStrategiesTests.jl b/test/AdaptivityFlagsMarkingStrategiesTests.jl index 5d951ca..c1e034d 100644 --- a/test/AdaptivityFlagsMarkingStrategiesTests.jl +++ b/test/AdaptivityFlagsMarkingStrategiesTests.jl @@ -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) + dΩ = 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 @@ -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