- nrNumber of refinements
C++ Type:unsigned int
Range:nr >= 0
Controllable:No
Description:Number of refinements
- radiusSphere (ball) radius
C++ Type:Real
Unit:(no unit assumed)
Range:radius > 0.0
Controllable:No
Description:Sphere (ball) radius
SphereMeshGenerator
Generate a sphere (ball) mesh centered on the origin
Overview
The SphereMeshGenerator creates a mesh of a sphere (a ball, not its boundary). The mesh refinement and smoothing parameters define the mesh density. Figure 1 depicts several sphere meshes (sliced in half to illustrate the interior elements) for different selections of refinement and smoothing parameters.

Figure 1: Sphere meshes created with different choices for refinement level and smoothing operations
The dimension of the generated mesh is determined by the selected elem_type. 3D element types will cause a ball volume to be meshed, 2D element types will cause a circular area (disk) to be meshed, and 1D element types will cause a line segment to be meshed.
Input Parameters
- elem_typeThe type of element to generate
C++ Type:MooseEnum
Options:EDGE, EDGE2, EDGE3, EDGE4, QUAD, QUAD4, QUAD8, QUAD9, TRI3, TRI6, HEX, HEX8, HEX20, HEX27, TET4, TET10, PRISM6, PRISM15, PRISM18, PYRAMID5, PYRAMID13, PYRAMID14
Controllable:No
Description:The type of element to generate
- n_smooth0Number of smoothing operations
Default:0
C++ Type:unsigned int
Controllable:No
Description:Number of smoothing operations
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/meshgenerators/sphere_mesh_generator/flat.i)
- (test/tests/meshgenerators/surface_subdomains_from_all_normals/test_flipped.i)
- (test/tests/meshgenerators/sphere_mesh_generator/sphere_quad.i)
- (test/tests/meshgenerators/surface_subdomains_from_all_normals/test_fixed.i)
- (test/tests/userobjects/point_in_polyhedron/fixed_x_ray.i)
- (test/tests/meshgenerators/boundary_2d_delaunay_generator/sphere.i)
- (test/tests/meshgenerators/sphere_mesh_generator/sphere_hex27.i)
- (modules/heat_transfer/test/tests/directional_flux_bc/3d.i)
- (test/tests/meshgenerators/sphere_mesh_generator/sphere.i)
- (test/tests/misc/ad_curvature/test.i)
- (test/tests/meshgenerators/rbb_mapping_converter/circle_rbb.i)
- (test/tests/meshgenerators/surface_subdomains_from_all_normals/test_two_parts.i)
- (modules/shifted_boundary_method/test/tests/in_out_test/3D_lambda0.i)
- (test/tests/meshgenerators/surface_subdomains_from_all_normals/test_flood.i)
- (tutorials/shield_multiphysics/inputs/step11_multiapps/step11_local.i)
- (test/tests/userobjects/point_in_union/union_mesh_and_stl.i)
- (test/tests/meshgenerators/sphere_mesh_generator/smooth.i)
- (test/tests/meshgenerators/surface_subdomains_delaunay_remesher/remesh_sphere.i)
- (modules/shifted_boundary_method/test/tests/in_out_test/3D_lambda1.i)
- (modules/shifted_boundary_method/test/tests/in_out_test/3D_lambda0p5.i)
(test/tests/meshgenerators/sphere_mesh_generator/flat.i)
[Mesh]
[sphere]
type = SphereMeshGenerator
radius = 1.0
nr = 2
flat = true
[]
[]
[Outputs]
exodus = true
[]
(test/tests/meshgenerators/surface_subdomains_from_all_normals/test_flipped.i)
[Mesh]
[sphere_vol]
type = SphereMeshGenerator
nr = 1
radius = 2
[]
[sphere_surf_sub]
type = LowerDBlockFromSidesetGenerator
input = 'sphere_vol'
sidesets = '0'
new_block_name = 'sphere_surf'
[]
[sphere_surf_mesh]
type = BlockToMeshConverterGenerator
input = 'sphere_surf_sub'
target_blocks = 'sphere_surf'
[]
[assign_a_subdomain_at_top]
type = SurfaceSubdomainsFromAllNormalsGenerator
input = 'sphere_surf_mesh'
normal_tol = 0.3
normal = '0 0 -1'
# otherwise we will start painting and the 'normal' is only used
# to select the starting elements for painting
fixed_normal = true
show_info = true
[]
[flip_these_elements]
type = OrientSurfaceMeshGenerator
input = 'assign_a_subdomain_at_top'
included_subdomains = '2'
normal_to_align_with = '0 0 1'
[]
[repaint_over_ignoring_flips]
type = SurfaceSubdomainsFromAllNormalsGenerator
input = 'flip_these_elements'
# large enough to paint over the entire sphere, from wherever we start
normal_tol = 0.45
# no need to paint elements multiple times
flood_elements_once = true
# ignore the orientation flips
consider_flipped_normals = true
flipped_normal_tol = 0.45
# flip the elements too (not required, but can help downstream generators)
flip_inverted_normals = true
[]
# The ordering of the elements matters for the flooding/painting loops
allow_renumbering = false
[]
(test/tests/meshgenerators/sphere_mesh_generator/sphere_quad.i)
[Mesh]
[sphere]
type = SphereMeshGenerator
radius = 1.0
nr = 2
elem_type = QUAD4
[]
[]
(test/tests/meshgenerators/surface_subdomains_from_all_normals/test_fixed.i)
[Mesh]
[sphere_vol]
type = SphereMeshGenerator
nr = 1
radius = 2
[]
[sphere_surf_sub]
type = LowerDBlockFromSidesetGenerator
input = 'sphere_vol'
sidesets = '0'
new_block_name = 'sphere_surf'
[]
[sphere_surf_mesh]
type = BlockToMeshConverterGenerator
input = 'sphere_surf_sub'
target_blocks = 'sphere_surf'
[]
[assign_a_subdomain_at_top]
type = SurfaceSubdomainsFromAllNormalsGenerator
input = 'sphere_surf_mesh'
normal_tol = 0.3
normal = '0 0 -1'
# otherwise we will start painting and the 'normal' is only used
# to select the starting elements for painting
fixed_normal = true
[]
# The ordering of the elements matters for the flooding/painting loops
allow_renumbering = false
[]
(test/tests/userobjects/point_in_polyhedron/fixed_x_ray.i)
# Framework point-in-polyhedron test using only MooseTestApp objects.
#
# A closed TRI3 surface (the shell of a TET4 sphere) is saved and handed to a
# BoundaryMeshBuilder. A PointInPolyhedronCheckUO with the fixed_x_ray backend
# (the TriangleManifold engine) classifies element centroids of the background
# mesh via a SpatialUserObjectAux (1 inside/on, 0 outside).
cx = 2.0
cy = 2.0
cz = 2.0
[Problem]
solve = false
[]
[Mesh]
[ball]
type = SphereMeshGenerator
radius = 1.0
nr = 1
elem_type = TET4
[]
[shell]
type = LowerDBlockFromSidesetGenerator
input = ball
sidesets = '0'
new_block_id = 100
[]
[extract]
type = BlockToMeshConverterGenerator
input = shell
target_blocks = '100'
[]
[surface_mesh]
type = TransformGenerator
transform = TRANSLATE
vector_value = '${cx} ${cy} ${cz}'
input = extract
save_with_name = 'surface_mesh'
[]
[gen]
type = CartesianMeshGenerator
dim = 3
dx = '4'
dy = '4'
dz = '4'
ix = '8'
iy = '8'
iz = '8'
subdomain_id = '1'
[]
final_generator = 'gen'
[]
[AuxVariables]
[inside]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[inside]
type = SpatialUserObjectAux
variable = inside
user_object = in_out_test
execute_on = 'initial'
[]
[]
[UserObjects]
[surface_builder]
type = BoundaryMeshBuilder
surface_mesh = surface_mesh
[]
[in_out_test]
type = PointInPolyhedronCheckUO
builder = surface_builder
point_containment_method = fixed_x_ray
[]
[]
[VectorPostprocessors]
[point_containment]
type = SpatialUserObjectVectorPostprocessor
userobject = in_out_test
points = '${cx} ${cy} ${cz}
0 0 0'
execute_on = initial
[]
[]
[Executioner]
type = Steady
[]
[Outputs]
exodus = true
csv = true
execute_on = initial
[]
(test/tests/meshgenerators/boundary_2d_delaunay_generator/sphere.i)
[Mesh]
[sphere]
type = SphereMeshGenerator
nr = 2
radius = 1
[]
[bdry]
type = ParsedGenerateSideset
combinatorial_geometry = 'z>0.5'
new_sideset_name = 'bdry'
input = 'sphere'
included_boundaries = '0'
[]
[hole]
type = ParsedGenerateSideset
combinatorial_geometry = 'z>0.8'
new_sideset_name = 'hole'
input = 'bdry'
included_boundaries = '0'
[]
[b2dd]
type = Boundary2DDelaunayGenerator
input = hole
boundary_names = 'bdry'
hole_boundary_names = 'hole'
use_auto_area_func = true
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Transient
num_steps = 1
[]
[Postprocessors]
[area]
type = VolumePostprocessor
[]
[]
[Outputs]
[csv]
type = CSV
execute_on = 'FINAL'
[]
[]
(test/tests/meshgenerators/sphere_mesh_generator/sphere_hex27.i)
[Mesh]
[sphere]
type = SphereMeshGenerator
radius = 1.0
nr = 2
elem_type = HEX27
[]
[]
(modules/heat_transfer/test/tests/directional_flux_bc/3d.i)
[Mesh]
[planet]
type = SphereMeshGenerator
radius = 1
nr = 2 # increase for a better visualization
[]
[moon]
type = SphereMeshGenerator
radius = 0.3
nr = 1 # increase for a better visualization
[]
[combine]
type = CombinerGenerator
inputs = 'planet moon'
positions = '0 0 0 -1.2 -1 -1'
[]
[]
[GlobalParams]
illumination_flux = '1 1 1'
[]
[Variables]
[u]
[]
[v]
[]
[]
[Kernels]
[diff_u]
type = Diffusion
variable = u
[]
[dt_u]
type = TimeDerivative
variable = u
[]
[diff_v]
type = Diffusion
variable = v
[]
[dt_v]
type = TimeDerivative
variable = v
[]
[]
[BCs]
[flux_u]
type = DirectionalFluxBC
variable = u
boundary = 0
[]
[flux_v]
type = DirectionalFluxBC
variable = v
boundary = 0
self_shadow_uo = shadow
[]
[]
[Postprocessors]
[ave_v_all]
type = SideAverageValue
variable = v
boundary = 0
[]
[ave_v_exposed]
type = ExposedSideAverageValue
variable = v
boundary = 0
self_shadow_uo = shadow
[]
[]
[UserObjects]
[shadow]
type = SelfShadowSideUserObject
boundary = 0
execute_on = INITIAL
[]
[]
[Executioner]
type = Transient
dt = 0.1
num_steps = 1
[]
[Outputs]
[out]
type = Exodus
execute_on = FINAL
[]
[]
(test/tests/meshgenerators/sphere_mesh_generator/sphere.i)
[Mesh]
[sphere]
type = SphereMeshGenerator
radius = 1.0
nr = 2
[]
[]
(test/tests/misc/ad_curvature/test.i)
[Mesh]
[sphere]
type = SphereMeshGenerator
radius = 1
nr = 1
elem_type = HEX27
[]
[]
[Problem]
solve = false
[]
[AuxVariables]
[curvature]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[curvature]
variable = curvature
type = ADCurvatureAux
execute_on = 'initial'
boundary = 0
[]
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
[]
[Postprocessors]
[average]
type = SideAverageValue
execute_on = 'initial'
variable = curvature
boundary = 0
[]
[]
(test/tests/meshgenerators/rbb_mapping_converter/circle_rbb.i)
[Mesh]
[sphere]
type = SphereMeshGenerator
radius = 1.0
nr = 0
elem_type = QUAD9
[]
[rbb]
type = RBBMappingConverter
input = sphere
[]
[]
[Executioner]
type = Steady
[Quadrature]
# Manual quadrature order, or we default to 0 with no variables and
# our VolumePostprocessor is stuck with that
order = FIFTH
[]
[]
[Postprocessors]
[volume]
type = VolumePostprocessor
[]
[]
[Problem]
solve = false
[]
[Outputs]
[output]
type = CSV
[]
[]
(test/tests/meshgenerators/surface_subdomains_from_all_normals/test_two_parts.i)
[Mesh]
[sphere_vol]
type = SphereMeshGenerator
nr = 1
radius = 2
[]
[sphere_surf_sub]
type = LowerDBlockFromSidesetGenerator
input = 'sphere_vol'
sidesets = '0'
new_block_name = 'sphere_surf'
[]
[sphere_surf_mesh]
type = BlockToMeshConverterGenerator
input = 'sphere_surf_sub'
target_blocks = 'sphere_surf'
[]
[two_spheres]
type = CombinerGenerator
inputs = 'sphere_surf_mesh'
positions = '0 0 0
2 0 0'
[]
[assign_subdomains]
type = SurfaceSubdomainsFromAllNormalsGenerator
input = 'two_spheres'
# loose enough to paint over each coarse sphere
normal_tol = 0.45
contiguous_assignments_only = true
# no need to paint over each sphere 24 times
flood_elements_once = true
[]
# The ordering of the elements matters for the flooding/painting loops
allow_renumbering = false
[]
(modules/shifted_boundary_method/test/tests/in_out_test/3D_lambda0.i)
nx = 16
lambda = 0
# Immersed triaxial ellipsoid: three distinct semi-axes make the boundary
# anisotropic so PCA has a well-separated shortest axis, giving a reproducible
# auto ray direction. Off-grid center keeps the surface cutting elements at
# generic fractions with no node/quadrature point landing exactly on it.
ax = 1.5
ay = 1.15
az = 0.85
cx = 2.03
cy = 1.97
cz = 2.05
[Problem]
solve = false
[]
[Mesh]
[ball]
type = SphereMeshGenerator
radius = 1.0
nr = 1
elem_type = TET4
[]
[shell]
type = LowerDBlockFromSidesetGenerator
input = ball
sidesets = '0'
new_block_id = 100
[]
[extract]
type = BlockToMeshConverterGenerator
input = shell
target_blocks = '100'
[]
[scale]
type = TransformGenerator
transform = SCALE
vector_value = '${ax} ${ay} ${az}'
input = extract
[]
[shift_boundary_mesh]
type = TransformGenerator
transform = TRANSLATE
vector_value = '${cx} ${cy} ${cz}'
input = scale
save_with_name = 'shift_boundary_mesh'
[]
[gen]
type = CartesianMeshGenerator
dim = 3
dx = '4'
dy = '4'
dz = '4'
ix = '${nx}'
iy = '${nx}'
iz = '${nx}'
subdomain_id = '1'
[]
add_subdomain_ids = 2 # outside block
add_sideset_names = 'SBMinterface'
final_generator = 'gen'
[]
[UserObjects]
[TreeBuilder]
type = SBMSurfaceMeshBuilder
check_watertightness = true
surface_mesh = shift_boundary_mesh
[]
[inout_test]
type = PointInPolyhedronCheckUO
builder = TreeBuilder
[]
[]
[MeshModifiers]
[IntercpetedESM]
type = InterceptedElementModifier
subdomain_id_inside = 1
subdomain_id_outside = 2
lambda = ${lambda}
is_domain_inside_surface = true
in_out_test = inout_test
execute_on = 'INITIAL'
execution_order_group = 0
[]
[SBMinterface]
type = SidesetAroundSubdomainUpdater
inner_subdomains = 1
outer_subdomains = 2
update_sideset_name = 'SBMinterface'
assign_outer_surface_sides = false
execute_on = 'INITIAL'
execution_order_group = 1
block = '1 2' # need to override default block
[]
[]
[Variables]
[u]
initial_condition = 1
block = 1
[]
[]
[Executioner]
type = Steady
[]
[Outputs]
exodus = true
[]
(test/tests/meshgenerators/surface_subdomains_from_all_normals/test_flood.i)
[Mesh]
[sphere_vol]
type = SphereMeshGenerator
nr = 1
radius = 2
[]
[sphere_surf_sub]
type = LowerDBlockFromSidesetGenerator
input = 'sphere_vol'
sidesets = '0'
new_block_name = 'sphere_surf'
[]
[sphere_surf_mesh]
type = BlockToMeshConverterGenerator
input = 'sphere_surf_sub'
target_blocks = 'sphere_surf'
[]
[assign_subdomains_in_patches]
type = SurfaceSubdomainsFromAllNormalsGenerator
input = 'sphere_surf_mesh'
normal_tol = 0.5
# makes a couple subdomains. Note that we 'painting' over the same
# elements multiple times because 'flood_elements_once' is not set to true
max_subdomain_size_centroids = 1.818
[]
# The ordering of the elements matters for the flooding/painting loops
allow_renumbering = false
[]
(tutorials/shield_multiphysics/inputs/step11_multiapps/step11_local.i)
[Mesh]
# We make a 3D sphere, but really this could be done in 1D
[sphere]
type = SphereMeshGenerator
radius = 10
nr = 3
n_smooth = 10
[]
# Dimensions of each layer are not realistic
[HDPE_inner]
type = ParsedSubdomainMeshGenerator
input = 'sphere'
combinatorial_geometry = 'x*x + y*y + z*z < 2*2'
block_id = 1
[]
[boron_inner]
type = ParsedSubdomainMeshGenerator
input = 'HDPE_inner'
combinatorial_geometry = '(x*x + y*y + z*z > 2*2) & (x*x + y*y + z*z < 3*3)'
block_id = 2
[]
[HDPE_mid]
type = ParsedSubdomainMeshGenerator
input = 'boron_inner'
combinatorial_geometry = '(x*x + y*y + z*z > 3*3) & (x*x + y*y + z*z < 6*6)'
block_id = 3
[]
[boron_mid]
type = ParsedSubdomainMeshGenerator
input = 'HDPE_mid'
combinatorial_geometry = '(x*x + y*y + z*z > 6*6) & (x*x + y*y + z*z < 7*7)'
block_id = 4
[]
[HDPE_outer]
type = ParsedSubdomainMeshGenerator
input = 'boron_mid'
combinatorial_geometry = 'x*x + y*y + z*z > 7*7'
block_id = 5
[]
[rename]
type = RenameBlockGenerator
input = 'HDPE_outer'
old_block = '1 2 3 4 5'
new_block = 'HDPE_inner boron_inner HDPE_mid boron_mid HDPE_outer'
[]
[rename_boundary]
type = RenameBoundaryGenerator
input = 'rename'
old_boundary = '0'
new_boundary = 'outer'
[]
# length_unit = 0.01
[scale]
type = TransformGenerator
input = rename_boundary
transform = SCALE
vector_value = '0.01 0.01 0.01'
[]
[]
[Variables]
[T]
initial_condition = 300
[]
[]
# Solve heat equation, with a source from boron absorption
[Kernels]
[conduction]
type = HeatConduction
variable = T
[]
[source]
type = CoupledForce
variable = T
block = 'boron_inner boron_mid'
v = flux
# 2 is our arbitrary value for the group cross section
coef = 2
[]
[]
[BCs]
[outer]
type = PostprocessorDirichletBC
boundary = 'outer'
variable = 'T'
postprocessor = 'T_boundary'
[]
[]
[AuxVariables]
# Received from the main solve
[flux]
initial_condition = 1e5
[]
[]
[Materials]
[hdpe]
type = HeatConductionMaterial
block = 'HDPE_inner HDPE_mid HDPE_outer'
# arbitrary
thermal_conductivity = 10
[]
[boron]
type = HeatConductionMaterial
block = 'boron_inner boron_mid'
# arbitrary
thermal_conductivity = 7
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Postprocessors]
# Used for boundary condition, received from the main solve
[T_boundary]
type = Receiver
default = 320
[]
# Compute those then send to the main app
[T_hdpe_out]
type = ElementAverageValue
variable = 'T'
block = 'HDPE_outer'
[]
[T_boron_mid]
type = ElementAverageValue
variable = 'T'
block = 'boron_mid'
[]
[T_hdpe_mid]
type = ElementAverageValue
variable = 'T'
block = 'HDPE_mid'
[]
[T_boron_inner]
type = ElementAverageValue
variable = 'T'
block = 'boron_inner'
[]
[T_hdpe_inner]
type = ElementAverageValue
variable = 'T'
block = 'HDPE_inner'
[]
[]
[Outputs]
exodus = true
[]
(test/tests/userobjects/point_in_union/union_mesh_and_stl.i)
# Three-dimensional union of two closed TRI3 surfaces given in mixed
# representations: a generator-built sphere shell (the boundary of a TET4 sphere)
# and a tetrahedron read from tetrahedron.stl. A point is contained when it is
# inside either surface.
[Problem]
solve = false
[]
[Mesh]
# Generator-built closed surface: extract the outer TRI3 shell of a TET4 sphere
# and translate it to sit well above the STL tetrahedron, leaving a clear gap so
# the two contained regions are visually distinct.
[ball]
type = SphereMeshGenerator
radius = 1.0
nr = 2
elem_type = TET4
[]
[shell]
type = LowerDBlockFromSidesetGenerator
input = ball
sidesets = '0'
new_block_id = 100
[]
[extract]
type = BlockToMeshConverterGenerator
input = shell
target_blocks = '100'
[]
[sphere_surf]
type = TransformGenerator
transform = TRANSLATE
vector_value = '2.0 2.0 4.5'
input = extract
save_with_name = 'sphere_surf'
[]
# Closed surface read from an STL file (a tetrahedron spanning z in [1, 3]).
[tet_surf]
type = FileMeshGenerator
file = tetrahedron.stl
save_with_name = 'tet_surf'
[]
[gen]
type = CartesianMeshGenerator
dim = 3
dx = '4'
dy = '4'
dz = '6'
ix = '8'
iy = '8'
iz = '12'
subdomain_id = '1'
[]
final_generator = 'gen'
[]
[AuxVariables]
[inside]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[inside]
type = SpatialUserObjectAux
variable = inside
user_object = union
execute_on = 'initial'
[]
[]
[UserObjects]
[builder1]
type = BoundaryMeshBuilder
surface_mesh = sphere_surf
[]
[builder2]
type = BoundaryMeshBuilder
surface_mesh = tet_surf
[]
[check1]
type = PointInPolyhedronCheckUO
builder = builder1
point_containment_method = pca_ray
[]
[check2]
type = PointInPolyhedronCheckUO
builder = builder2
point_containment_method = pca_ray
[]
[union]
type = PointInUnionCheckUO
providers = 'check1 check2'
[]
[]
[Executioner]
type = Steady
[]
[Outputs]
exodus = true
[]
(test/tests/meshgenerators/sphere_mesh_generator/smooth.i)
[Mesh]
[sphere]
type = SphereMeshGenerator
radius = 1.0
nr = 2
n_smooth = 1
[]
[]
(test/tests/meshgenerators/surface_subdomains_delaunay_remesher/remesh_sphere.i)
[Mesh]
# Create a base sphere surface mesh
[sphere_vol]
type = SphereMeshGenerator
nr = 1
radius = 2
[]
[sphere_surf_sub]
type = LowerDBlockFromSidesetGenerator
input = 'sphere_vol'
sidesets = '0'
new_block_name = 'sphere_surf'
[]
[sphere_surf_mesh]
type = BlockToMeshConverterGenerator
input = 'sphere_surf_sub'
target_blocks = 'sphere_surf'
[]
# Divide it up in patches that can be flattened
[create_patches]
type = SurfaceSubdomainsFromAllNormalsGenerator
input = 'sphere_surf_mesh'
normal_tol = 0.3
# so we limit the size of the patches to a certain angle range
fixed_normal = true
# no need to paint the sphere multiple times
flood_elements_once = true
[]
# Remesh the patches using triangle elements
[remesh]
type = SurfaceSubdomainsDelaunayRemesher
input = 'create_patches'
# keep the subdomains in this test
avoid_merging_subdomains = true
verbose = true
[]
# Diagnostics
[diag]
type = MeshDiagnosticsGenerator
input = remesh
examine_element_overlap = WARNING
examine_element_types = WARNING
examine_element_volumes = WARNING
examine_non_conformality = WARNING
examine_nonplanar_sides = INFO
examine_sidesets_orientation = WARNING
search_for_adaptivity_nonconformality = WARNING
check_local_jacobian = WARNING
[]
# The ordering of the elements matters for the flooding/painting loops
allow_renumbering = false
[]
(modules/shifted_boundary_method/test/tests/in_out_test/3D_lambda1.i)
nx = 16
lambda = 1
# Immersed triaxial ellipsoid: three distinct semi-axes make the boundary
# anisotropic so PCA has a well-separated shortest axis, giving a reproducible
# auto ray direction. Off-grid center keeps the surface cutting elements at
# generic fractions with no node/quadrature point landing exactly on it.
ax = 1.5
ay = 1.15
az = 0.85
cx = 2.03
cy = 1.97
cz = 2.05
[Problem]
solve = false
[]
[Mesh]
[ball]
type = SphereMeshGenerator
radius = 1.0
nr = 1
elem_type = TET4
[]
[shell]
type = LowerDBlockFromSidesetGenerator
input = ball
sidesets = '0'
new_block_id = 100
[]
[extract]
type = BlockToMeshConverterGenerator
input = shell
target_blocks = '100'
[]
[scale]
type = TransformGenerator
transform = SCALE
vector_value = '${ax} ${ay} ${az}'
input = extract
[]
[shift_boundary_mesh]
type = TransformGenerator
transform = TRANSLATE
vector_value = '${cx} ${cy} ${cz}'
input = scale
save_with_name = 'shift_boundary_mesh'
[]
[gen]
type = CartesianMeshGenerator
dim = 3
dx = '4'
dy = '4'
dz = '4'
ix = '${nx}'
iy = '${nx}'
iz = '${nx}'
subdomain_id = '1'
[]
add_subdomain_ids = 2 # outside block
add_sideset_names = 'SBMinterface'
final_generator = 'gen'
[]
[UserObjects]
[TreeBuilder]
type = SBMSurfaceMeshBuilder
check_watertightness = true
surface_mesh = shift_boundary_mesh
[]
[inout_test]
type = PointInPolyhedronCheckUO
builder = TreeBuilder
[]
[]
[MeshModifiers]
[IntercpetedESM]
type = InterceptedElementModifier
subdomain_id_inside = 1
subdomain_id_outside = 2
lambda = ${lambda}
is_domain_inside_surface = true
in_out_test = inout_test
execute_on = 'INITIAL'
execution_order_group = 0
[]
[SBMinterface]
type = SidesetAroundSubdomainUpdater
inner_subdomains = 1
outer_subdomains = 2
update_sideset_name = 'SBMinterface'
assign_outer_surface_sides = false
execute_on = 'INITIAL'
execution_order_group = 1
block = '1 2' # need to override default block
[]
[]
[Variables]
[u]
initial_condition = 1
block = 1
[]
[]
[Executioner]
type = Steady
[]
[Outputs]
exodus = true
[]
(modules/shifted_boundary_method/test/tests/in_out_test/3D_lambda0p5.i)
nx = 16
lambda = 0.5
# Immersed triaxial ellipsoid: three distinct semi-axes make the boundary
# anisotropic so PCA has a well-separated shortest axis, giving a reproducible
# auto ray direction. Off-grid center keeps the surface cutting elements at
# generic fractions with no node/quadrature point landing exactly on it.
ax = 1.5
ay = 1.15
az = 0.85
cx = 2.03
cy = 1.97
cz = 2.05
[Problem]
solve = false
[]
[Mesh]
[ball]
type = SphereMeshGenerator
radius = 1.0
nr = 1
elem_type = TET4
[]
[shell]
type = LowerDBlockFromSidesetGenerator
input = ball
sidesets = '0'
new_block_id = 100
[]
[extract]
type = BlockToMeshConverterGenerator
input = shell
target_blocks = '100'
[]
[scale]
type = TransformGenerator
transform = SCALE
vector_value = '${ax} ${ay} ${az}'
input = extract
[]
[shift_boundary_mesh]
type = TransformGenerator
transform = TRANSLATE
vector_value = '${cx} ${cy} ${cz}'
input = scale
save_with_name = 'shift_boundary_mesh'
[]
[gen]
type = CartesianMeshGenerator
dim = 3
dx = '4'
dy = '4'
dz = '4'
ix = '${nx}'
iy = '${nx}'
iz = '${nx}'
subdomain_id = '1'
[]
add_subdomain_ids = 2 # outside block
add_sideset_names = 'SBMinterface'
final_generator = 'gen'
[]
[UserObjects]
[TreeBuilder]
type = SBMSurfaceMeshBuilder
check_watertightness = true
surface_mesh = shift_boundary_mesh
[]
[inout_test]
type = PointInPolyhedronCheckUO
builder = TreeBuilder
[]
[]
[MeshModifiers]
[IntercpetedESM]
type = InterceptedElementModifier
subdomain_id_inside = 1
subdomain_id_outside = 2
lambda = ${lambda}
is_domain_inside_surface = true
in_out_test = inout_test
execute_on = 'INITIAL'
execution_order_group = 0
[]
[SBMinterface]
type = SidesetAroundSubdomainUpdater
inner_subdomains = 1
outer_subdomains = 2
update_sideset_name = 'SBMinterface'
assign_outer_surface_sides = false
execute_on = 'INITIAL'
execution_order_group = 1
block = '1 2' # need to override default block
[]
[]
[Variables]
[u]
initial_condition = 1
block = 1
[]
[]
[Executioner]
type = Steady
[]
[Outputs]
exodus = true
[]