Skip to content

Commit

Permalink
Add test (idaholab#23557)
Browse files Browse the repository at this point in the history
  • Loading branch information
dschwen committed Mar 3, 2023
1 parent 0ab106a commit d6d5238
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 0 deletions.
1 change: 1 addition & 0 deletions framework/doc/content/source/mesh/MooseMesh.md
Expand Up @@ -36,6 +36,7 @@ You could also use the [SideSetsFromNodeSetsGenerator.md] class to construct sid
sets (or the [NodeSetsFromSideSetsGenerator.md] for vice versa). These object allows you to manually
construct the relevant side sets and node sets earlier in the mesh generation process.

To declare subdomain IDs which are not found on the mesh right after the mesh is setup, a list of IDs can be specified using the `Mesh/add_subdomain_ids` parameter. This permits setting up block restricted objects that will only act on subdomains created during the simulation (e.g. using the[CoupledVarThresholdElementSubdomainModifier.md]).

## Minimal interface

Expand Down
56 changes: 56 additions & 0 deletions test/tests/mesh/add_subdomain_ids/add_subdomain_ids.i
@@ -0,0 +1,56 @@
[Mesh]
[generate]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
[]
add_subdomain_ids = 999
[]

[Variables]
[u]
[]
[]

[Kernels]
[diff]
type = Diffusion
variable = u
[]
[diff2]
type = MatDiffusion
diffusivity = 2
variable = u
block = 999
[]
[]

[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]

[Executioner]
type = Steady

# Preconditioned JFNK (default)
solve_type = 'PJFNK'

petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]

[Outputs]
exodus = true
[]
10 changes: 10 additions & 0 deletions test/tests/mesh/add_subdomain_ids/tests
@@ -0,0 +1,10 @@
[Tests]
[add_subdomain_ids]
type = Exodiff
input = add_subdomain_ids.i
exodiff = add_subdomain_ids_out.e
issues = '#23557'
design = MooseMesh.md
requirement = 'The system shall allow specifying valid subdomain IDs that do not exist on the initial mesh'
[]
[]

0 comments on commit d6d5238

Please sign in to comment.