- blockThe list of blocks to be refined
C++ Type:std::vector<SubdomainName>
Controllable:No
Description:The list of blocks to be refined
- inputInput mesh to refine
C++ Type:MeshGeneratorName
Controllable:No
Description:Input mesh to refine
- refinementMinimum amount of times to refine each block, corresponding to their index in 'block'. A single value can be specified to refine all blocks.
C++ Type:std::vector<unsigned int>
Controllable:No
Description:Minimum amount of times to refine each block, corresponding to their index in 'block'. A single value can be specified to refine all blocks.
RefineBlockGenerator
Mesh generator which refines one or more blocks in an existing mesh
Overview
This MeshGenerator object allows the user to refine one or more blocks in a mesh.
The user has to provide the ids of the blocks to be modified, as well as the corresponding levels of refinement for each block. These must match up to the order of the aforementioned block id list, e.g. if the blocks you wish to modify are '0 2 1 4', with 1 refinement for block 0, 2 for block 2, 3 for block 1, and 4 for block 4, then the refinement list will need to look like '1 2 3 4'. By default, refinement in libMesh refines neighboring blocks to avoid meshing problems. This generator shares this default, but it can be disabled with "enable_neighbor_refinement=false".
Input Parameters
- enable_neighbor_refinementTrueToggles whether neighboring level one elements should be refined or not. Defaults to true. False may lead to unsupported mesh non-conformality without great care.
Default:True
C++ Type:bool
Controllable:No
Description:Toggles whether neighboring level one elements should be refined or not. Defaults to true. False may lead to unsupported mesh non-conformality without great care.
- max_element_volume1e+08If elements are above that size, they will be refined more
Default:1e+08
C++ Type:Real
Unit:(no unit assumed)
Controllable:No
Description:If elements are above that size, they will be refined more
Optional Parameters
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Controllable:No
Description:Set the enabled status of the MooseObject.
- save_with_nameKeep the mesh from this mesh generator in memory with the name specified
C++ Type:std::string
Controllable:No
Description:Keep the mesh from this mesh generator in memory with the name specified
Advanced Parameters
- nemesisFalseWhether or not to output the mesh file in the nemesisformat (only if output = true)
Default:False
C++ Type:bool
Controllable:No
Description:Whether or not to output the mesh file in the nemesisformat (only if output = true)
- outputFalseWhether or not to output the mesh file after generating the mesh
Default:False
C++ Type:bool
Controllable:No
Description:Whether or not to output the mesh file after generating the mesh
- show_infoFalseWhether or not to show mesh info after generating the mesh (bounding box, element types, sidesets, nodesets, subdomains, etc)
Default:False
C++ Type:bool
Controllable:No
Description:Whether or not to show mesh info after generating the mesh (bounding box, element types, sidesets, nodesets, subdomains, etc)
Debugging Parameters
Input Files
- (test/tests/postprocessors/side_average_value/side_average_functor_test.i)
- (test/tests/meshgenerators/refine_block_generator/test_multi.i)
- (test/tests/meshgenerators/refine_block_generator/test_single.i)
- (test/tests/problems/eigen_problem/jfnk_mo/ne_array_mo.i)
- (test/tests/interfacekernels/nonconforming/coarse_primary.i)
- (test/tests/problems/eigen_problem/eigensolvers/ne.i)
- (modules/electromagnetics/test/tests/benchmarks/dipole_antenna/dipole.i)
- (test/tests/interfacekernels/nonconforming/fine_primary.i)
- (test/tests/indicators/gradient_jump_indicator/gradient_jump_indicator_fv_test.i)
- (test/tests/meshgenerators/coarsen_block_generator/coarsen_hex_multi.i)
- (test/tests/meshgenerators/mesh_diagnostics_generator/detect_amr_tet.i)
- (test/tests/meshgenerators/flatten_refinement_generator/flatten_refinement.i)
- (test/tests/meshgenerators/coarsen_block_generator/coarsen_quad_multi.i)
- (test/tests/postprocessors/side_integral/side_integral_functor.i)
- (test/tests/meshgenerators/block_to_mesh_converter_generator/conv_multiblock.i)
(test/tests/postprocessors/side_average_value/side_average_functor_test.i)
[Mesh]
inactive = 'refine'
# U-shaped domains to have internal boundaries in
# a variety of directions
[cmg]
type = CartesianMeshGenerator
dim = 2
dx = '1 1 1'
dy = '3 1'
ix = '4 5 3'
iy = '12 4'
subdomain_id = '1 2 1
1 1 1'
[]
[internal_boundary_dir1]
type = SideSetsBetweenSubdomainsGenerator
input = cmg
primary_block = 1
paired_block = 2
new_boundary = 'inside_1'
[]
[internal_boundary_dir2]
type = SideSetsBetweenSubdomainsGenerator
input = internal_boundary_dir1
primary_block = 2
paired_block = 1
new_boundary = 'inside_2'
[]
[refine]
type = RefineBlockGenerator
input = internal_boundary_dir2
block = '1 2'
refinement = '2 1'
[]
[]
[Variables]
[u]
type = MooseVariableFVReal
block = 1
[]
[]
[AuxVariables]
[v1]
type = MooseVariableFVReal
block = 1
[FVInitialCondition]
type = FVFunctionIC
function = 'x + y'
[]
[]
[v2]
type = MooseVariableFVReal
block = 2
[FVInitialCondition]
type = FVFunctionIC
function = '2*x*x - y'
[]
[]
[]
[Functions]
[f1]
type = ParsedFunction
expression = 'exp(x - y)'
[]
[]
[FunctorMaterials]
[m1]
type = ADGenericFunctorMaterial
prop_names = 'm1'
prop_values = 'f1'
[]
[m2]
type = ADPiecewiseByBlockFunctorMaterial
prop_name = 'm2'
subdomain_to_prop_value = '1 12
2 4'
[]
[]
[FVKernels]
[diff]
type = FVDiffusion
variable = u
coeff = '1'
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
variable = u
boundary = 3
value = 0
[]
[right]
type = FVDirichletBC
variable = u
boundary = 1
value = 1
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Postprocessors]
# Mesh external boundaries integration
[ext_u]
type = SideAverageFunctorPostprocessor
boundary = 'left top right'
functor = u
restrict_to_functors_domain = true
[]
[ext_u_int]
type = ADSideIntegralFunctorPostprocessor
boundary = 'left top right'
functor = u
restrict_to_functors_domain = true
[]
[ext_u_area]
type = AreaPostprocessor
boundary = 'left top right'
[]
[ext_u_diff]
type = ParsedPostprocessor
pp_names = 'ext_u ext_u_int ext_u_area'
expression = 'ext_u - ext_u_int/ext_u_area'
[]
[ext_v1]
type = SideAverageFunctorPostprocessor
boundary = 'left right'
functor = v1
[]
[ext_v2]
type = SideAverageFunctorPostprocessor
boundary = 'top'
functor = v2
restrict_to_functors_domain = true
[]
[ext_f1]
type = SideAverageFunctorPostprocessor
boundary = 'left top right'
functor = f1
prefactor = f1
[]
[ext_m1]
type = SideAverageFunctorPostprocessor
boundary = 'left top right'
functor = m1
restrict_to_functors_domain = true
[]
[ext_m2]
type = SideAverageFunctorPostprocessor
boundary = 'left top right'
functor = m2
restrict_to_functors_domain = true
[]
# Internal to the mesh, but a side to the variables
# With orientation of normal 1->2
[int_s1_u]
type = SideAverageFunctorPostprocessor
boundary = inside_1
functor = u
[]
[int_s1_v1]
type = SideAverageFunctorPostprocessor
boundary = inside_1
functor = v1
[]
[int_s1_f1]
type = SideAverageFunctorPostprocessor
boundary = inside_1
functor = f1
[]
[int_s1_m1]
type = SideAverageFunctorPostprocessor
boundary = inside_1
functor = m1
[]
[int_s1_m2]
type = SideAverageFunctorPostprocessor
boundary = inside_1
functor = m2
[]
# With orientation of normal 2->1
[int_s2_v2]
type = SideAverageFunctorPostprocessor
boundary = inside_2
functor = v2
[]
[int_s2_f1]
type = SideAverageFunctorPostprocessor
boundary = inside_2
functor = f1
[]
[int_s2_m1]
type = SideAverageFunctorPostprocessor
boundary = inside_2
functor = m1
[]
[int_s2_m2]
type = SideAverageFunctorPostprocessor
boundary = inside_2
functor = m2
[]
[]
[Outputs]
csv = true
exodus = true
[]
[Problem]
kernel_coverage_check = false
[]
(test/tests/meshgenerators/refine_block_generator/test_multi.i)
[Mesh]
[eg]
type = CartesianMeshGenerator
dim = 3
dx = '2 1 1'
dy = '2 3'
dz = '0.4 0.5 0.6 0.7'
ix = '2 1 1'
iy = '2 3'
iz = '1 1 1 1'
subdomain_id = '0 1 1 1
1 2 0 1
0 1 1 1
2 2 2 2
2 3 1 2
1 1 1 1'
[]
[refine]
type = RefineBlockGenerator
input = eg
block = '0 1 2 3'
refinement = '3 2 1 0'
enable_neighbor_refinement = false
[]
[]
[Outputs]
exodus = true
[]
(test/tests/meshgenerators/refine_block_generator/test_single.i)
[Mesh]
[eg]
type = CartesianMeshGenerator
dim = 3
dx = '2 1 1'
dy = '2 3'
dz = '0.4 0.5 0.6 0.7'
ix = '2 1 1'
iy = '2 3'
iz = '1 1 1 1'
subdomain_id = '0 1 1 1
1 2 0 1
0 1 1 1
2 2 2 2
2 3 1 2
1 1 1 1'
[]
[refine]
type = RefineBlockGenerator
input = eg
block = '3'
refinement = '1'
enable_neighbor_refinement = false
[]
[]
[Outputs]
exodus = true
[]
(test/tests/problems/eigen_problem/jfnk_mo/ne_array_mo.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 10
ymin = 0
ymax = 10
elem_type = QUAD4
nx = 8
ny = 8
[]
[left_block]
type = SubdomainBoundingBoxGenerator
bottom_left = '0 0 0'
top_right = '5 10 0'
block_id = 1
input = gen
[]
[refine]
type = RefineBlockGenerator
input = left_block
refinement = '0 0'
block = '1 0'
[]
[]
# the minimum eigenvalue of this problem is 2*(PI/a)^2;
# Its inverse is 0.5*(a/PI)^2 = 5.0660591821169. Here a is equal to 10.
[Variables]
[u]
order = FIRST
family = LAGRANGE
components = 2
[]
[v]
order = FIRST
family = LAGRANGE
components = 2
[]
[]
[Kernels]
[diffu]
type = ArrayDiffusion
variable = u
diffusion_coefficient = dc
[]
[reactionu]
type = ArrayReaction
variable = u
reaction_coefficient = rc
extra_vector_tags = 'eigen'
[]
[diffv]
type = ArrayDiffusion
variable = v
diffusion_coefficient = dc
[]
[reactionv]
type = ArrayReaction
variable = v
reaction_coefficient = rc
extra_vector_tags = 'eigen'
[]
[]
[Materials]
[dc]
type = GenericConstantArray
prop_name = dc
prop_value = '1. 1.'
[]
[rc]
type = GenericConstantArray
prop_name = rc
prop_value = '-1 -1'
[]
[]
[BCs]
[hom_u]
type = ArrayDirichletBC
variable = u
values = '0 0'
boundary = '0 1 2 3'
[]
[eigenhom_u]
type = EigenArrayDirichletBC
variable = u
boundary = '0 1 2 3'
[]
[hom_v]
type = ArrayDirichletBC
variable = v
values = '0 0'
boundary = '0 1 2 3'
[]
[eigenhom_v]
type = EigenArrayDirichletBC
variable = v
boundary = '0 1 2 3'
[]
[]
[Executioner]
type = Eigenvalue
solve_type = PJFNKMO
constant_matrices = true
[]
[VectorPostprocessors]
[./eigenvalues]
type = Eigenvalues
execute_on = 'timestep_end'
[../]
[]
[Outputs]
csv = true
execute_on = 'timestep_end'
[]
(test/tests/interfacekernels/nonconforming/coarse_primary.i)
# The 'gas' block is initially refined one level beyond 'sol', so each 'sol' element's face on
# the interface borders four active 'gas' children instead of one. primary_block (the side that
# carries the 'interface' boundary tag, and thus the side InterfaceKernels are evaluated on) is
# the coarser 'sol' side here, exercising the one-coarse-primary-to-many-fine-neighbors case.
[Mesh]
[base]
type = CartesianMeshGenerator
dim = 3
dx = '1 1'
ix = '1 1'
dy = 1
iy = 2
dz = 1
iz = 2
subdomain_id = '0 1'
[]
[refine]
input = base
type = RefineBlockGenerator
block = 1
refinement = 1
[]
[interface]
type = SideSetsBetweenSubdomainsGenerator
input = refine
new_boundary = interface
primary_block = 0
paired_block = 1
[]
[rename]
input = interface
type = RenameBlockGenerator
old_block = '0 1'
new_block = 'sol gas'
[]
[]
[Variables]
[c_H2]
family = LAGRANGE
block = gas
[]
[c_2H]
family = LAGRANGE
block = sol
[]
[]
[AuxVariables]
[w]
block = sol
[]
[]
[AuxKernels]
[w]
type = FunctionAux
variable = w
function = '1 + y + 2 * z'
execute_on = INITIAL
[]
[]
[Kernels]
[diff_gas]
type = ADMatDiffusion
variable = c_H2
diffusivity = diffusivity
block = gas
[]
[diff_solid]
type = ADMatDiffusion
variable = c_2H
diffusivity = diffusivity
block = sol
[]
[]
[Materials]
[gas_diff]
type = ADGenericConstantMaterial
prop_names = 'diffusivity'
prop_values = 1
block = gas
[]
[solid_diff]
type = ADGenericConstantMaterial
prop_names = 'diffusivity'
prop_values = 0.25
block = sol
[]
# The solid-side interface rate depends on an auxiliary variable, which must be evaluated at the
# same physical points as the nonlinear variables on each face
[solid_rate]
type = ADParsedMaterial
property_name = k_sol
coupled_variables = w
expression = 'w'
block = sol
[]
[gas_rate]
type = ADGenericConstantMaterial
prop_names = 'k_gas'
prop_values = 2
block = gas
[]
[]
[InterfaceKernels]
[reaction]
type = ADMatInterfaceReaction
variable = c_2H
neighbor_var = c_H2
forward_rate = k_sol
backward_rate = k_gas
boundary = interface
[]
[]
[BCs]
[left]
type = ADDirichletBC
variable = c_2H
boundary = left
value = 0
[]
[right]
type = ADDirichletBC
variable = c_H2
boundary = right
value = 1
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_abs_tol = 1e-12
[]
[Postprocessors]
[steel_inventory]
type = ADElementIntegralFunctorPostprocessor
functor = c_2H
block = sol
[]
[gas_inventory]
type = ADElementIntegralFunctorPostprocessor
functor = c_H2
block = gas
[]
[total_inventory]
type = LinearCombinationPostprocessor
pp_coefs = '1 1'
pp_names = 'steel_inventory gas_inventory'
[]
[]
[Outputs]
csv = true
[]
(test/tests/problems/eigen_problem/eigensolvers/ne.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 10
ymin = 0
ymax = 10
elem_type = QUAD4
nx = 8
ny = 8
[]
[left_block]
type = SubdomainBoundingBoxGenerator
bottom_left = '0 0 0'
top_right = '5 10 0'
block_id = 1
input = gen
[]
[refine]
type = RefineBlockGenerator
input = left_block
refinement = '0 0'
block = '1 0'
[]
[]
# the minimum eigenvalue of this problem is 2*(PI/a)^2;
# Its inverse is 0.5*(a/PI)^2 = 5.0660591821169. Here a is equal to 10.
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[./rhs]
type = CoefReaction
variable = u
coefficient = -1.0
extra_vector_tags = 'eigen'
[../]
[]
[BCs]
[./homogeneous]
type = DirichletBC
variable = u
boundary = '0 1 2 3'
value = 0
[../]
[./eigen]
type = EigenDirichletBC
variable = u
boundary = '0 1 2 3'
[../]
[]
[Executioner]
type = Eigenvalue
solve_type = PJFNK
[]
[VectorPostprocessors]
[./eigenvalues]
type = Eigenvalues
execute_on = 'timestep_end'
[../]
[]
[Outputs]
csv = true
file_base = monolith_newton
execute_on = 'timestep_end'
[]
(modules/electromagnetics/test/tests/benchmarks/dipole_antenna/dipole.i)
# Verification Benchmark - Half-wave Dipole Antenna (Frequency Domain)
# Resonant Frequency = 1 GHz
# Wave Propagation Medium: Vacuum
[Mesh]
[file_mesh]
type = FileMeshGenerator
file = dipole_antenna_1G.msh
[]
[refine]
type = RefineBlockGenerator
input = file_mesh
block = 'vacuum'
refinement = 2
[]
[]
[Variables]
[E_real]
order = FIRST
family = NEDELEC_ONE
[]
[E_imag]
order = FIRST
family = NEDELEC_ONE
[]
[]
[Functions]
[WaveNumberSquared]
type = ParsedFunction
expression = '(2*pi*1e9/3e8)*(2*pi*1e9/3e8)'
[]
[]
[Kernels]
[curl_curl_real]
type = CurlCurlField
variable = E_real
[]
[coeff_real]
type = VectorFunctionReaction
variable = E_real
function = WaveNumberSquared
sign = negative
[]
[curl_curl_imag]
type = CurlCurlField
variable = E_imag
[]
[coeff_imag]
type = VectorFunctionReaction
variable = E_imag
function = WaveNumberSquared
sign = negative
[]
[]
[BCs]
[antenna_real] # Impose exact solution of electric field onto antenna surface.
type = VectorCurlPenaltyDirichletBC # Replace with proper antenna surface current condition.
penalty = 1e5
function_y = '1'
boundary = antenna
variable = E_real
[]
[antenna_imag]
type = VectorCurlPenaltyDirichletBC
penalty = 1e5
function_y = '1'
boundary = antenna
variable = E_imag
[]
[radiation_condition_real]
type = VectorEMRobinBC
variable = E_real
coupled_field = E_imag
boundary = boundary
component = real
mode = absorbing
beta = 20.9439510239 # wave number at 1 GHz
[]
[radiation_condition_imag]
type = VectorEMRobinBC
variable = E_imag
coupled_field = E_real
boundary = boundary
component = imaginary
mode = absorbing
beta = 20.9439510239 # wave number at 1 GHz
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Outputs]
exodus = true
perf_graph = true
[]
(test/tests/interfacekernels/nonconforming/fine_primary.i)
# Same mesh and physics as coarse_primary.i, but primary_block (the side that carries the
# 'interface' boundary tag) is the finer 'gas' side instead. This direction already worked before
# the coarse-primary fix; it is kept as a regression guard and should give identical inventories
# to coarse_primary.i, since swapping which side is "primary" is purely a bookkeeping choice.
[Mesh]
[base]
type = CartesianMeshGenerator
dim = 3
dx = '1 1'
ix = '1 1'
dy = 1
iy = 2
dz = 1
iz = 2
subdomain_id = '0 1'
[]
[refine]
input = base
type = RefineBlockGenerator
block = 1
refinement = 1
[]
[interface]
type = SideSetsBetweenSubdomainsGenerator
input = refine
new_boundary = interface
primary_block = 1
paired_block = 0
[]
[rename]
input = interface
type = RenameBlockGenerator
old_block = '0 1'
new_block = 'sol gas'
[]
[]
[Variables]
[c_H2]
family = LAGRANGE
block = gas
[]
[c_2H]
family = LAGRANGE
block = sol
[]
[]
[AuxVariables]
[w]
block = sol
[]
[]
[AuxKernels]
[w]
type = FunctionAux
variable = w
function = '1 + y + 2 * z'
execute_on = INITIAL
[]
[]
[Kernels]
[diff_gas]
type = ADMatDiffusion
variable = c_H2
diffusivity = diffusivity
block = gas
[]
[diff_solid]
type = ADMatDiffusion
variable = c_2H
diffusivity = diffusivity
block = sol
[]
[]
[Materials]
[gas_diff]
type = ADGenericConstantMaterial
prop_names = 'diffusivity'
prop_values = 1
block = gas
[]
[solid_diff]
type = ADGenericConstantMaterial
prop_names = 'diffusivity'
prop_values = 0.25
block = sol
[]
# The solid-side interface rate depends on an auxiliary variable, which must be evaluated at the
# same physical points as the nonlinear variables on each face
[solid_rate]
type = ADParsedMaterial
property_name = k_sol
coupled_variables = w
expression = 'w'
block = sol
[]
[gas_rate]
type = ADGenericConstantMaterial
prop_names = 'k_gas'
prop_values = 2
block = gas
[]
[]
[InterfaceKernels]
[reaction]
type = ADMatInterfaceReaction
variable = c_H2
neighbor_var = c_2H
forward_rate = k_gas
backward_rate = k_sol
boundary = interface
[]
[]
[BCs]
[left]
type = ADDirichletBC
variable = c_2H
boundary = left
value = 0
[]
[right]
type = ADDirichletBC
variable = c_H2
boundary = right
value = 1
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_abs_tol = 1e-12
[]
[Postprocessors]
[steel_inventory]
type = ADElementIntegralFunctorPostprocessor
functor = c_2H
block = sol
[]
[gas_inventory]
type = ADElementIntegralFunctorPostprocessor
functor = c_H2
block = gas
[]
[total_inventory]
type = LinearCombinationPostprocessor
pp_coefs = '1 1'
pp_names = 'steel_inventory gas_inventory'
[]
[]
[Outputs]
csv = true
[]
(test/tests/indicators/gradient_jump_indicator/gradient_jump_indicator_fv_test.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
xmax = 2
nx = 2
ny = 1
subdomain_ids = '0 1'
[]
[interface_mesh]
type = SideSetsBetweenSubdomainsGenerator
input = gmg
primary_block = 0
paired_block = 1
new_boundary = interface
[]
# This creates enough elements to have defined gradients
[refine]
type = RefineBlockGenerator
input = interface_mesh
block = '0 1'
refinement = '3 3'
[]
[]
[Adaptivity]
marker = error_frac
max_h_level = 5
[Indicators]
[u0_jump]
type = GradientJumpIndicator
variable = u0
scale_by_flux_faces = false
[]
[]
[Markers]
[error_frac]
type = ErrorFractionMarker
coarsen = 0.15
indicator = u0_jump
refine = 0.7
[]
[]
[]
[Variables]
[u0]
family = MONOMIAL
order = CONSTANT
fv = true
block = 0
initial_condition = 0
[]
[u1]
family = MONOMIAL
order = CONSTANT
fv = true
block = 1
initial_condition = 0
[]
[]
[FVKernels]
[time0]
type = FVTimeKernel
variable = u0
[]
[diff0]
type = FVDiffusion
variable = u0
coeff = 1
block = 0
[]
[time1]
type = FVTimeKernel
variable = u1
[]
[diff1]
type = FVDiffusion
variable = u1
coeff = 1
block = 1
[]
[]
[FVInterfaceKernels]
[diffusion]
type = FVDiffusionInterface
variable1 = u0
variable2 = u1
boundary = interface
subdomain1 = 0
subdomain2 = 1
coeff1 = 1
coeff2 = 1
[]
[]
[FVBCs]
[left] # arbitrary user-chosen name
type = FVDirichletBC
variable = u0
boundary = 'left' # This must match a named boundary in the mesh file
value = 1
[]
[right] # arbitrary user-chosen name
type = FVNeumannBC
variable = u1
boundary = 'right' # This must match a named boundary in the mesh file
value = 0
[]
[]
[Executioner]
type = Transient
solve_type = 'Newton'
end_time = 0.5
dt = 0.1
[]
[VectorPostprocessors]
[samples]
type = LineValueSampler
variable = u0
# Avoiding element faces
start_point = '0.0001 1e-6 0'
end_point = '0.999999 1e-6 0'
num_points = 10
sort_by = 'x'
[]
[]
[Outputs]
execute_on = 'timestep_end'
csv = true
[]
(test/tests/meshgenerators/coarsen_block_generator/coarsen_hex_multi.i)
[Mesh]
allow_renumbering = false
# use these two to re-generate input.e
[eg]
type = CartesianMeshGenerator
dim = 3
dx = '2 1 1'
dy = '2 3'
dz = '2 3'
ix = '2 1 1'
iy = '2 3'
iz = '3 2'
subdomain_id = '0 1 1
1 2 0
0 1 1
1 2 0'
[]
[add_internal]
type = SideSetsBetweenSubdomainsGenerator
input = eg
paired_block = 1
primary_block = 2
new_boundary = middle
[]
[refine]
type = RefineBlockGenerator
input = add_internal
block = '0 1 2'
refinement = '1 1 1'
enable_neighbor_refinement = false
output = true
[]
final_generator = 'diag'
[input]
type = FileMeshGenerator
file = 'single_nonuniform_hex.e'
[]
# Go back to what we had
[coarsen]
type = CoarsenBlockGenerator
input = input
block = '0 1 2'
coarsening = '1 1 1'
# This was found by looking at the output of refine
# careful, has transitions we dont support!
starting_point = '2.75 0.75 0'
maximum_volume_ratio = 4
verbose = true
[]
[diag]
type = MeshDiagnosticsGenerator
input = coarsen
examine_element_overlap = ERROR
search_for_adaptivity_nonconformality = WARNING
examine_non_conformality = WARNING
[]
[]
[Outputs]
exodus = true
[]
(test/tests/meshgenerators/mesh_diagnostics_generator/detect_amr_tet.i)
[Mesh]
[big_one]
type = GeneratedMeshGenerator
dim = 3
nx = 1
ny = 1
nz = 1
xmin = 1
xmax = 2
ymin = 0
ymax = 1
zmin = 0
zmax = 1
elem_type = TET4
[]
[cut_one]
type = GeneratedMeshGenerator
dim = 3
nx = 1
ny = 1
nz = 1
xmin = 0
xmax = 1
ymin = 0
ymax = 1
zmin = 0
zmax = 1
elem_type = TET4
[]
[refined]
type = RefineBlockGenerator
input = cut_one
refinement = 1
block = 0
[]
[cmbn]
type = StitchedMeshGenerator
inputs = 'big_one refined'
stitch_boundaries_pairs = 'left right'
[]
[diag]
type = MeshDiagnosticsGenerator
input = cmbn
search_for_adaptivity_nonconformality = INFO
[]
[]
[Outputs]
exodus = true
[]
(test/tests/meshgenerators/flatten_refinement_generator/flatten_refinement.i)
[Mesh]
[eg]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 2
[]
# Produce an h-refined mesh that still carries its refinement tree
[refine]
type = RefineBlockGenerator
input = eg
block = '0'
refinement = '1'
[]
# Flatten the refinement tree back into ordinary level-0 elements
[flatten]
type = FlattenRefinementGenerator
input = refine
[]
[]
(test/tests/meshgenerators/coarsen_block_generator/coarsen_quad_multi.i)
[Mesh]
# use these two to re-generate input.e
[eg]
type = CartesianMeshGenerator
dim = 2
dx = '2 1 1'
dy = '2 3'
ix = '2 1 1'
iy = '2 3'
subdomain_id = '0 1 1
1 2 0'
[]
[add_internal]
type = SideSetsBetweenSubdomainsGenerator
input = eg
paired_block = 0
primary_block = 2
new_boundary = middle
[]
[refine]
type = RefineBlockGenerator
input = add_internal
block = '0 1 2'
refinement = '0 1 1'
enable_neighbor_refinement = false
output = true
[]
final_generator = 'diag'
[input]
type = FileMeshGenerator
file = 'single_nonuniform.e'
[]
# Go back to what we had
[coarsen]
type = CoarsenBlockGenerator
input = input
block = '0 1 2'
coarsening = '0 1 1'
# This was found by looking at the output of refine
# careful, has transitions we dont support!
starting_point = '2.75 0.75 0'
verbose = true
[]
[diag]
type = MeshDiagnosticsGenerator
input = coarsen
examine_element_overlap = ERROR
search_for_adaptivity_nonconformality = WARNING
examine_non_conformality = WARNING
[]
[]
[Outputs]
exodus = true
[]
(test/tests/postprocessors/side_integral/side_integral_functor.i)
[Mesh]
inactive = 'refine'
# U-shaped domains to have internal boundaries in
# a variety of directions
[cmg]
type = CartesianMeshGenerator
dim = 2
dx = '1 1 1'
dy = '3 1'
ix = '4 5 3'
iy = '12 4'
subdomain_id = '1 2 1
1 1 1'
[]
[internal_boundary_dir1]
type = SideSetsBetweenSubdomainsGenerator
input = cmg
primary_block = 1
paired_block = 2
new_boundary = 'inside_1'
[]
[internal_boundary_dir2]
type = SideSetsBetweenSubdomainsGenerator
input = internal_boundary_dir1
primary_block = 2
paired_block = 1
new_boundary = 'inside_2'
[]
[refine]
type = RefineBlockGenerator
input = internal_boundary_dir2
block = '1 2'
refinement = '2 1'
[]
[]
[Variables]
[u]
type = MooseVariableFVReal
block = 1
[]
[]
[AuxVariables]
[v1]
type = MooseVariableFVReal
block = 1
[FVInitialCondition]
type = FVFunctionIC
function = 'x + y'
[]
[]
[v2]
type = MooseVariableFVReal
block = 2
[FVInitialCondition]
type = FVFunctionIC
function = '2*x*x - y'
[]
[]
[]
[Functions]
[f1]
type = ParsedFunction
expression = 'exp(x - y)'
[]
[]
[Materials]
[m1]
type = ADGenericFunctorMaterial
prop_names = 'm1'
prop_values = 'f1'
[]
[m2]
type = ADPiecewiseByBlockFunctorMaterial
prop_name = 'm2'
subdomain_to_prop_value = '1 12
2 4'
[]
[]
[FVKernels]
[diff]
type = FVDiffusion
variable = u
coeff = '1'
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
variable = u
boundary = 3
value = 0
[]
[right]
type = FVDirichletBC
variable = u
boundary = 1
value = 1
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Postprocessors]
# Mesh external boundaries integration
[ext_u]
type = ADSideIntegralFunctorPostprocessor
boundary = 'left top right'
functor = u
restrict_to_functors_domain = true
[]
[ext_v1]
type = ADSideIntegralFunctorPostprocessor
boundary = 'left right'
functor = v1
[]
[ext_v2]
type = ADSideIntegralFunctorPostprocessor
boundary = 'top'
functor = v2
restrict_to_functors_domain = true
[]
[ext_f1]
type = ADSideIntegralFunctorPostprocessor
boundary = 'left top right'
functor = f1
prefactor = f1
[]
[ext_m1]
type = ADSideIntegralFunctorPostprocessor
boundary = 'left top right'
functor = m1
restrict_to_functors_domain = true
[]
[ext_m2]
type = ADSideIntegralFunctorPostprocessor
boundary = 'left top right'
functor = m2
restrict_to_functors_domain = true
[]
# Internal to the mesh, but a side to the variables
# With orientation of normal 1->2
[int_s1_u]
type = ADSideIntegralFunctorPostprocessor
boundary = inside_1
functor = u
[]
[int_s1_v1]
type = ADSideIntegralFunctorPostprocessor
boundary = inside_1
functor = v1
[]
[int_s1_f1]
type = ADSideIntegralFunctorPostprocessor
boundary = inside_1
functor = f1
[]
[int_s1_m1]
type = ADSideIntegralFunctorPostprocessor
boundary = inside_1
functor = m1
[]
[int_s1_m2]
type = ADSideIntegralFunctorPostprocessor
boundary = inside_1
functor = m2
[]
# With orientation of normal 2->1
[int_s2_v2]
type = ADSideIntegralFunctorPostprocessor
boundary = inside_2
functor = v2
[]
[int_s2_f1]
type = ADSideIntegralFunctorPostprocessor
boundary = inside_2
functor = f1
[]
[int_s2_m1]
type = ADSideIntegralFunctorPostprocessor
boundary = inside_2
functor = m1
[]
[int_s2_m2]
type = ADSideIntegralFunctorPostprocessor
boundary = inside_2
functor = m2
[]
[]
[Outputs]
csv = true
exodus = true
[]
[Problem]
kernel_coverage_check = false
[]
(test/tests/meshgenerators/block_to_mesh_converter_generator/conv_multiblock.i)
[Mesh]
inactive = 'refine'
[file]
type = FileMeshGenerator
file = 3dmultiblock.e
[]
[blockToMesh]
type = BlockToMeshConverterGenerator
input = file
target_blocks = "1 12 2 3 5 6"
[]
[refine]
type = RefineBlockGenerator
input = file
block = '12'
refinement = '1'
[]
# added to preserve the old gold file when all blocks were merged into block 0
[change_block_names]
type = RenameBlockGenerator
input = blockToMesh
old_block = '1 12 2 3 5 6'
new_block = '0 0 0 0 0 0'
[]
[]