Skip to content

Commit

Permalink
Add test for block restriciton of indicators
Browse files Browse the repository at this point in the history
  • Loading branch information
GiudGiud committed Sep 22, 2024
1 parent 973a13b commit a8982c8
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 0 deletions.
Binary file not shown.
87 changes: 87 additions & 0 deletions test/tests/adaptivity/block_restriction/test.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
[Mesh]
[box]
type = GeneratedMeshGenerator
dim = 3
nx = 3
ny = 3
nz = 3
xmin = 0
xmax = 1
ymin = 0
ymax = 1
zmin = 0
zmax = 1
[]
[box1]
type = SubdomainBoundingBoxGenerator
input = box
block_id = 1
bottom_left = '0 0.5 0'
top_right = '1 1 1'
[]
[]

[Variables]
[u]
[]
[]

[Kernels]
[diff]
type = Diffusion
variable = u
[]
[source]
type = BodyForce
variable = u
function = '(x-0.5) * (x-0.5) * (x-0.5)'
[]
[]

[BCs]
[archor_x]
type = DirichletBC
boundary = 'bottom'
variable = u
value = 0
[]
[]

[Adaptivity]
marker = errorfrac
max_h_level = 2
[Indicators]
[error]
type = GradientJumpIndicator
variable = u
block = '0'
[]
[]
[Markers]
[errorfrac]
type = ErrorFractionMarker
refine = 0.5
indicator = error
block = '0'
[]
[]
[]

[Executioner]
type = Transient

end_time = 200
dt = 100

solve_type = 'PJFNK'

nl_abs_tol = 1E-5
nl_max_its = 400

l_tol = 1E-8
l_max_its = 200
[]

[Outputs]
exodus = true
[]
17 changes: 17 additions & 0 deletions test/tests/adaptivity/block_restriction/tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[Tests]
design = 'syntax/Adaptivity/index.md'
issues = '#14531'
[block]
type = Exodiff
input = 'test.i'
exodiff = 'test_out.e-s002'
requirement = 'The system shall be able to use block-restricted indicators for adaptivity.'
[]
[mismatch]
type = RunException
input = test.i
cli_args = 'Adaptivity/Markers/errorfrac/block="0 1"'
expect_err = 'The block restriction of the marker is larger than the block restriction of its indicator.'
requirement = 'The system shall emit a warning if the block restriction of the marker is larger than that of its indicator.'
[]
[]

0 comments on commit a8982c8

Please sign in to comment.