- mesh_divisionThe mesh division providing the value
C++ Type:MeshDivisionName
Controllable:No
Description:The mesh division providing the value
- variableThe name of the variable that this object applies to
C++ Type:AuxVariableName
Unit:(no unit assumed)
Controllable:No
Description:The name of the variable that this object applies to
MeshDivisionAux
Returns the value of the mesh division index for each element / node
This AuxKernel can be helpful to test a new MeshDivision object by visualizing the division. It could also be used to form conditional logic based on the location of the element, and its indexing in the MeshDivision, in a ParsedAux.
Input Parameters
- blockThe list of blocks (ids or names) that this object will be applied
C++ Type:std::vector<SubdomainName>
Controllable:No
Description:The list of blocks (ids or names) that this object will be applied
- boundaryThe list of boundaries (ids or names) from the mesh where this object applies
C++ Type:std::vector<BoundaryName>
Controllable:No
Description:The list of boundaries (ids or names) from the mesh where this object applies
- check_boundary_restrictedTrueWhether to check for multiple element sides on the boundary in the case of a boundary restricted, element aux variable. Setting this to false will allow contribution to a single element's elemental value(s) from multiple boundary sides on the same element (example: when the restricted boundary exists on two or more sides of an element, such as at a corner of a mesh
Default:True
C++ Type:bool
Controllable:No
Description:Whether to check for multiple element sides on the boundary in the case of a boundary restricted, element aux variable. Setting this to false will allow contribution to a single element's elemental value(s) from multiple boundary sides on the same element (example: when the restricted boundary exists on two or more sides of an element, such as at a corner of a mesh
- execute_onLINEAR TIMESTEP_ENDThe list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html.
Default:LINEAR TIMESTEP_END
C++ Type:ExecFlagEnum
Options:XFEM_MARK, FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, LINEAR_CONVERGENCE, NONLINEAR, NONLINEAR_CONVERGENCE, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, MULTIAPP_FIXED_POINT_CONVERGENCE, FINAL, CUSTOM, PRE_DISPLACE
Controllable:No
Description:The list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html.
- output_invalid_value_as-1Convert the invalid value index for output purposes
Default:-1
C++ Type:int
Controllable:No
Description:Convert the invalid value index for output purposes
Optional Parameters
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
Controllable:No
Description:Adds user-defined labels for accessing object parameters via control logic.
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Controllable:Yes
Description:Set the enabled status of the MooseObject.
- seed0The seed for the master random number generator
Default:0
C++ Type:unsigned int
Controllable:No
Description:The seed for the master random number generator
- use_displaced_meshFalseWhether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Default:False
C++ Type:bool
Controllable:No
Description:Whether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Advanced Parameters
- prop_getter_suffixAn optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
C++ Type:MaterialPropertyName
Unit:(no unit assumed)
Controllable:No
Description:An optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
- use_interpolated_stateFalseFor the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
Default:False
C++ Type:bool
Controllable:No
Description:For the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
Material Property Retrieval Parameters
Input Files
- (test/tests/meshdivisions/nearest_position_division.i)
- (modules/reactor/test/tests/meshdivisions/hexagonal_division.i)
- (modules/reactor/test/tests/meshdivisions/hexagonal_division_positions.i)
- (test/tests/transfers/general_field/nearest_node/mesh_division/sub.i)
- (test/tests/transfers/general_field/nearest_node/mesh_division/main_match_division.i)
- (test/tests/transfers/general_field/nearest_node/mesh_division/main.i)
- (test/tests/meshdivisions/functor_values_division.i)
- (test/tests/meshdivisions/nested_division.i)
- (test/tests/transfers/general_field/shape_evaluation/mesh_division/main_match_subapps.i)
- (test/tests/meshdivisions/block_division.i)
- (test/tests/transfers/general_field/nearest_node/mesh_division/main_match_subapps.i)
- (test/tests/transfers/general_field/shape_evaluation/mesh_division/main.i)
- (test/tests/meshdivisions/cartesian_division.i)
- (test/tests/meshdivisions/extra_elem_id_division.i)
- (test/tests/transfers/general_field/shape_evaluation/mesh_division/sub.i)
- (test/tests/meshdivisions/cylindrical_division.i)
- (test/tests/meshdivisions/spherical_division.i)
(test/tests/meshdivisions/nearest_position_division.i)
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 3
dx = '1.5 2.4 0.1'
dy = '1.3 0.9'
dz = '0.4 0.5 0.6 0.7'
ix = '2 1 1'
iy = '2 3'
iz = '1 1 1 1'
[]
# To keep VPP output consistently ordered
allow_renumbering = false
[]
[Positions]
[input]
type = InputPositions
# avoid indetermination
positions = '0.0001 0 0
1 0 0
1.46543 2.1233 3.1211'
[]
[]
[MeshDivisions]
[nearest_pos_div]
type = NearestPositionsDivision
positions = input
[]
[]
[Functions]
[xf]
type = ParsedFunction
expression = 'x'
[]
[]
[AuxVariables]
[div]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[mesh_div]
type = MeshDivisionAux
variable = div
mesh_division = 'nearest_pos_div'
[]
[]
[VectorPostprocessors]
[div_out]
type = ElementValueSampler
variable = 'div'
sort_by = 'id'
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
[]
(modules/reactor/test/tests/meshdivisions/hexagonal_division.i)
# Increase resolution to check results visually
resolution = 3
z_resolution = 3
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 3
dx = '1.5 2.4 0.1'
dy = '1.3 0.9'
dz = '0.4 0.5 0.6 0.7'
ix = '${fparse 2 * resolution} ${fparse resolution} ${fparse z_resolution}'
iy = '${fparse 2 * resolution} ${fparse 3 * z_resolution}'
iz = '${fparse resolution} ${fparse resolution} ${fparse resolution} ${fparse z_resolution}'
[]
# To keep VPP output consistently ordered
allow_renumbering = false
[]
[MeshDivisions]
[hexagonal_div]
type = HexagonalGridDivision
nr = 4
nz = 2
lattice_flat_to_flat = 4
pin_pitch = 0.6
z_min = 0
z_max = 3
center = '1 1 0'
[]
[]
[AuxVariables]
[div]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[mesh_div]
type = MeshDivisionAux
variable = div
mesh_division = 'hexagonal_div'
[]
[]
[VectorPostprocessors]
[div_out]
type = ElementValueSampler
variable = 'div'
sort_by = 'id'
outputs = csv
[]
[]
[Postprocessors]
[npos]
type = NumMeshDivisions
mesh_division = 'hexagonal_div'
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
[]
(modules/reactor/test/tests/meshdivisions/hexagonal_division_positions.i)
pin_hex_size = 5
n_rings = 2
hex_size = '${fparse (2*n_rings - 1) * pin_hex_size}'
[Mesh]
[hex_pin]
type = PolygonConcentricCircleMeshGenerator
num_sides = 6
num_sectors_per_side = '2 2 2 2 2 2'
# Two position rings
ring_radii = '${fparse pin_hex_size / 2}'
ring_intervals = 1
polygon_size = ${pin_hex_size}
preserve_volumes = on
[]
[pattern_assembly]
type = PatternedHexMeshGenerator
inputs = 'hex_pin'
pattern = '0 0;
0 0 0;
0 0'
hexagon_size = ${hex_size}
background_intervals = 1
# If we deform the pin mesh to ease the transition with the background,
# we can get the wrong index for the hexagonal division
deform_non_circular_region = false
[]
[pattern_core]
type = PatternedHexMeshGenerator
inputs = 'pattern_assembly'
pattern = '0 0;
0 0 0;
0 0'
generate_core_metadata = true
pattern_boundary = none
# If we deform the pin mesh to ease the transition with the background,
# we can get the wrong index for the hexagonal division
deform_non_circular_region = false
[]
# To keep VPP output consistently ordered
allow_renumbering = false
[]
[Positions]
[assembly_centers]
type = InputPositions
# Assembly centers
positions = '0 0 0
${fparse -tan(pi/3) * hex_size} ${fparse -hex_size} 0
${fparse -tan(pi/3) * hex_size} ${fparse hex_size} 0
0 ${fparse -2 * hex_size} 0
0 ${fparse 2 * hex_size} 0
${fparse tan(pi/3) * hex_size} ${fparse -hex_size} 0
${fparse tan(pi/3) * hex_size} ${fparse hex_size} 0'
[]
[]
[MeshDivisions]
[hexagonal_div]
type = HexagonalGridDivision
nr = ${n_rings}
nz = 1
lattice_flat_to_flat = '${fparse 2 * hex_size}'
pin_pitch = '${fparse 2 * pin_hex_size}'
z_min = 0
z_max = 0
center_positions = assembly_centers
[]
[]
[AuxVariables]
[div]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[mesh_div]
type = MeshDivisionAux
variable = div
mesh_division = 'hexagonal_div'
[]
[]
[VectorPostprocessors]
[div_out]
type = ElementValueSampler
variable = 'div'
sort_by = 'id'
outputs = csv
[]
[]
[Postprocessors]
[npos]
type = NumMeshDivisions
mesh_division = 'hexagonal_div'
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
[]
(test/tests/transfers/general_field/nearest_node/mesh_division/sub.i)
base_value = 3
[Mesh]
type = GeneratedMesh
dim = 2
nx = 5
ny = 5
xmin = -0.1
ymin = -0.1
xmax = 0.1
ymax = 0.1
[]
[MeshDivisions]
[middle_sub]
type = CartesianGridDivision
# this division excludes the boundary nodes. The
# peaks in to_main on the boundaries should not be transferred
bottom_left = '-0.021 -0.021 0'
top_right = '0.081 0.081 0'
nx = 2
ny = 2
nz = 1
[]
[]
[AuxVariables]
[from_main]
initial_condition = -1
[]
[from_main_elem]
order = CONSTANT
family = MONOMIAL
initial_condition = -1
[]
[to_main]
[InitialCondition]
type = FunctionIC
function = '${base_value} + 20*x + 300*y*y*y'
[]
[]
[to_main_elem]
order = CONSTANT
family = MONOMIAL
[InitialCondition]
type = FunctionIC
function = '${base_value} + 1 + 20*x + 300*y*y*y'
[]
[]
[]
[UserObjects]
[to_main]
type = LayeredAverage
direction = x
num_layers = 10
variable = to_main
[]
[to_main_elem]
type = LayeredAverage
direction = x
num_layers = 10
variable = to_main_elem
[]
[]
[Executioner]
type = Transient
num_steps = 1
[]
[Problem]
solve = false
[]
[Outputs]
[out]
type = Exodus
hide = 'to_main to_main_elem div'
overwrite = true
[]
[]
# For debugging purposes
[AuxVariables]
[div]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[mesh_div]
type = MeshDivisionAux
variable = div
mesh_division = 'middle_sub'
[]
[]
(test/tests/transfers/general_field/nearest_node/mesh_division/main_match_division.i)
# Base input for testing transfers with mesh divisions restrictions with a mapping from
# source mesh divisions to target mesh divisions. It has the following complexities:
# - multiple sub-applications
# - transfers both from and to the subapps
# - both nodal and elemental variables
# Tests derived from this input may add complexities through command line arguments
# Explaining results on the main app:
# Each value on the main app comes from a region with the same division index on a subapp
# Because the subapp is not very discretized in Y, some source mesh division indices
# are not represented in the subapps. Therefore these mesh divisions are not present in the
# main app.
# Explaining results on the sub apps:
# Each subapp receives results for all its target mesh divisions. They are naturally all the
# same because they are all matched with the same source app (parent app) source division
# and the division on the parent app is too small to have more than 1 valid point + value
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[MeshDivisions]
[middle]
type = CartesianGridDivision
bottom_left = '0.21 0.21 0'
# cover more and sample more bins
top_right = '1.001 1.001 0'
nx = 5
ny = 5
nz = 1
[]
[]
[AuxVariables]
[from_sub]
initial_condition = -1
[]
[from_sub_elem]
order = CONSTANT
family = MONOMIAL
initial_condition = -1
[]
[to_sub]
[InitialCondition]
type = FunctionIC
function = '1 + 2*x*x + 3*y*y*y'
[]
[]
[to_sub_elem]
order = CONSTANT
family = MONOMIAL
[InitialCondition]
type = FunctionIC
function = '2 + 2*x*x + 3*y*y*y'
[]
[]
[]
[Executioner]
type = Steady
[]
[Problem]
solve = false
[]
[Outputs]
[out]
type = Exodus
hide = 'to_sub to_sub_elem div'
overwrite = true
[]
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
app_type = MooseTestApp
input_files = sub.i
output_in_position = true
# The positions are randomly offset to prevent equi-distant nearest-locations
positions = '0.1001 0.0000013 0
0.30054 0.600001985 0
0.70021 0.0000022 0
0.800212 0.5500022 0'
cli_args = "base_value=1;MeshDivisions/middle_sub/nx=5;MeshDivisions/middle_sub/ny=5;Mesh/nx=10 "
"base_value=2;MeshDivisions/middle_sub/nx=5;MeshDivisions/middle_sub/ny=5;Mesh/nx=10 "
"base_value=3;MeshDivisions/middle_sub/nx=5;MeshDivisions/middle_sub/ny=5;Mesh/nx=10 "
"base_value=4;MeshDivisions/middle_sub/nx=5;MeshDivisions/middle_sub/ny=5;Mesh/nx=10"
[]
[]
[Transfers]
[to_sub]
type = MultiAppGeneralFieldNearestLocationTransfer
to_multi_app = sub
source_variable = to_sub
variable = from_main
from_mesh_division = middle
from_mesh_division_usage = 'matching_division'
to_mesh_division = middle_sub
to_mesh_division_usage = 'matching_division'
# we avoid bounding boxes because the parent and children apps do
# not overlap so unless we grow the boxes to cover the entire source,
# the transfer will not pick up all the source mesh divisions
greedy_search = true
use_bounding_boxes = false
[]
[to_sub_elem]
type = MultiAppGeneralFieldNearestLocationTransfer
to_multi_app = sub
source_variable = to_sub_elem
variable = from_main_elem
from_mesh_division = middle
from_mesh_division_usage = 'matching_division'
to_mesh_division = middle_sub
to_mesh_division_usage = 'matching_division'
greedy_search = true
use_bounding_boxes = false
[]
[from_sub]
type = MultiAppGeneralFieldNearestLocationTransfer
from_multi_app = sub
source_variable = to_main
variable = from_sub
from_mesh_division = middle_sub
from_mesh_division_usage = 'matching_division'
to_mesh_division = middle
to_mesh_division_usage = 'matching_division'
greedy_search = true
use_bounding_boxes = false
# Test features non-overlapping meshes
error_on_miss = false
[]
[from_sub_elem]
type = MultiAppGeneralFieldNearestLocationTransfer
from_multi_app = sub
source_variable = to_main_elem
variable = from_sub_elem
from_mesh_division = middle_sub
from_mesh_division_usage = 'matching_division'
to_mesh_division = middle
to_mesh_division_usage = 'matching_division'
greedy_search = true
use_bounding_boxes = false
# Test features non-overlapping meshes
error_on_miss = false
[]
[]
# For debugging purposes
[AuxVariables]
[div]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[mesh_div]
type = MeshDivisionAux
variable = div
mesh_division = 'middle'
[]
[]
(test/tests/transfers/general_field/nearest_node/mesh_division/main.i)
# Base input for testing transfers. It has the following complexities:
# - transfers both from and to the subapps
# - both nodal and elemental variables
# Tests derived from this input may add complexities through command line arguments
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[MeshDivisions]
[middle]
type = CartesianGridDivision
bottom_left = '0.21 0.21 0'
top_right = '0.81 0.81 0'
nx = 2
ny = 2
nz = 1
[]
[]
[AuxVariables]
[from_sub]
initial_condition = -1
[]
[from_sub_elem]
order = CONSTANT
family = MONOMIAL
initial_condition = -1
[]
[to_sub]
[InitialCondition]
type = FunctionIC
function = '1 + 2*x*x + 3*y*y*y'
[]
[]
[to_sub_elem]
order = CONSTANT
family = MONOMIAL
[InitialCondition]
type = FunctionIC
function = '2 + 2*x*x + 3*y*y*y'
[]
[]
[]
[Executioner]
type = Steady
[]
[Problem]
solve = false
[]
[Outputs]
[out]
type = Exodus
hide = 'to_sub to_sub_elem div'
overwrite = true
[]
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
app_type = MooseTestApp
input_files = sub.i
output_in_position = true
# The positions are randomly offset to prevent equi-distant nearest-locations
positions = '0.1001 0.0000013 0
0.30054 0.600001985 0
0.70021 0.0000022 0
0.800212 0.5500022 0'
cli_args = 'base_value=1 base_value=2 base_value=3 base_value=4'
[]
[]
[Transfers]
[to_sub]
type = MultiAppGeneralFieldNearestLocationTransfer
to_multi_app = sub
source_variable = to_sub
variable = from_main
[]
[to_sub_elem]
type = MultiAppGeneralFieldNearestLocationTransfer
to_multi_app = sub
source_variable = to_sub_elem
variable = from_main_elem
[]
[from_sub]
type = MultiAppGeneralFieldNearestLocationTransfer
from_multi_app = sub
source_variable = to_main
variable = from_sub
[]
[from_sub_elem]
type = MultiAppGeneralFieldNearestLocationTransfer
from_multi_app = sub
source_variable = to_main_elem
variable = from_sub_elem
[]
[]
# For debugging purposes
[AuxVariables]
[div]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[mesh_div]
type = MeshDivisionAux
variable = div
mesh_division = 'middle'
[]
[]
(test/tests/meshdivisions/functor_values_division.i)
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 3
dx = '1.5 2.4 0.1'
dy = '1.3 0.9'
dz = '0.4 0.5 0.6 0.7'
ix = '2 1 1'
iy = '2 3'
iz = '1 1 1 1'
[]
# To keep VPP output consistently ordered
allow_renumbering = false
[]
[MeshDivisions]
[functor_div]
type = FunctorBinnedValuesDivision
min_value = 0.1
max_value = 2
num_bins = 3
functor = 'xf'
[]
[]
[Functions]
[xf]
type = ParsedFunction
expression = 'x'
[]
[]
[AuxVariables]
[div]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[mesh_div]
type = MeshDivisionAux
variable = div
mesh_division = 'functor_div'
[]
[]
[VectorPostprocessors]
[div_out]
type = ElementValueSampler
variable = 'div'
sort_by = 'id'
[]
[]
[Postprocessors]
[ndiv]
type = NumMeshDivisions
mesh_division = functor_div
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
[]
(test/tests/meshdivisions/nested_division.i)
[Mesh]
[fmg]
type = FileMeshGenerator
file = '../positions/depletion_id_in.e'
exodus_extra_element_integers = 'material_id pin_id assembly_id'
[]
# To keep VPP output consistently ordered
allow_renumbering = false
[]
[MeshDivisions]
[extra_id_div_1]
type = ExtraElementIntegerDivision
extra_id_name = 'material_id'
[]
[extra_id_div_2]
type = ExtraElementIntegerDivision
extra_id_name = 'pin_id'
[]
[nested_div]
type = NestedDivision
divisions = 'extra_id_div_2 extra_id_div_1'
[]
[]
[AuxVariables]
[div]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[mesh_div]
type = MeshDivisionAux
variable = div
mesh_division = 'nested_div'
[]
[]
[VectorPostprocessors]
[div_out]
type = ElementValueSampler
variable = 'div'
sort_by = 'id'
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
[]
(test/tests/transfers/general_field/shape_evaluation/mesh_division/main_match_subapps.i)
# Base input for testing transfers with mesh divisions restrictions. The mesh divisions
# in the parent app will be matched with a subapp index.
# In the to_multiapp direction, the main app data at the mesh division bins of index 1-4 will
# be transferred to subapps of index 1-4 respectively
# In the from_multiapp direction, the main app fields at the mesh divisions bins of index 1-4
# will receive data (be transferred) from subapps of index 1-4 respectively
# It has the following complexities:
# - several sub-applications
# - transfers both from and to the subapps
# - both nodal and elemental variables
# Tests derived from this input may add complexities through command line arguments
[Mesh]
type = GeneratedMesh
dim = 2
nx = 4
ny = 4
[]
[MeshDivisions]
[middle]
type = CartesianGridDivision
bottom_left = '0.21 0.21 0'
# cover more and sample more bins
top_right = '1.001 1.001 0'
nx = 2
ny = 2
nz = 1
[]
[]
[AuxVariables]
[from_sub]
initial_condition = -1
[]
[from_sub_elem]
order = CONSTANT
family = MONOMIAL
initial_condition = -1
[]
[to_sub]
[InitialCondition]
type = FunctionIC
function = '1 + 2*x*x + 3*y*y*y'
[]
[]
[to_sub_elem]
order = CONSTANT
family = MONOMIAL
[InitialCondition]
type = FunctionIC
function = '2 + 2*x*x + 3*y*y*y'
[]
[]
[]
[Executioner]
type = Steady
[]
[Problem]
solve = false
[]
[Outputs]
[out]
type = Exodus
hide = 'to_sub to_sub_elem div'
overwrite = true
[]
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
app_type = MooseTestApp
input_files = sub.i
output_in_position = true
# The positions are randomly offset to prevent equi-distant nearest-locations
# They are offset so they overlap with the division they are being matched to
positions = '-0.5001 -0.3000013 0
0.30054 -0.300001985 0
-0.30021 0.2000022 0
0.200212 0.4100022 0'
# To differentiate the values received from each subapp
cli_args = 'base_value=10 base_value=20 base_value=30 base_value=40'
[]
[]
[Transfers]
[to_sub]
type = MultiAppGeneralFieldShapeEvaluationTransfer
to_multi_app = sub
source_variable = to_sub
variable = from_main
from_mesh_division = middle
from_mesh_division_usage = 'matching_subapp_index'
# Test features non-overlapping meshes
error_on_miss = false
[]
[to_sub_elem]
type = MultiAppGeneralFieldShapeEvaluationTransfer
to_multi_app = sub
source_variable = to_sub_elem
variable = from_main_elem
from_mesh_division = middle
from_mesh_division_usage = 'matching_subapp_index'
# Test features non-overlapping meshes
error_on_miss = false
[]
[from_sub]
type = MultiAppGeneralFieldShapeEvaluationTransfer
from_multi_app = sub
source_variable = to_main
variable = from_sub
to_mesh_division = middle
to_mesh_division_usage = 'matching_subapp_index'
# Test features non-overlapping meshes
error_on_miss = false
[]
[from_sub_elem]
type = MultiAppGeneralFieldShapeEvaluationTransfer
from_multi_app = sub
source_variable = to_main_elem
variable = from_sub_elem
to_mesh_division = middle
to_mesh_division_usage = 'matching_subapp_index'
[]
[]
# For debugging purposes
[AuxVariables]
[div]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[mesh_div]
type = MeshDivisionAux
variable = div
mesh_division = 'middle'
[]
[]
(test/tests/meshdivisions/block_division.i)
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 3
dx = '1.5 2.4 0.1'
dy = '1.3 0.9'
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
2 2 2
3 4 4
5 5 5
0 1 1
2 2 2
3 4 4
5 5 5
'
[]
[]
[MeshDivisions]
[block_div]
type = SubdomainsDivision
[]
[]
[AuxVariables]
[blocks]
family = MONOMIAL
order = CONSTANT
[]
[div]
family = MONOMIAL
order = CONSTANT
[]
[diff]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[mesh_div]
type = MeshDivisionAux
variable = div
mesh_division = 'block_div'
[]
[subdomains]
type = FunctorAux
functor = 'blocks_fmat'
variable = 'blocks'
[]
[difference]
type = ParsedAux
variable = diff
expression = 'blocks - div'
coupled_variables = 'blocks div'
[]
[]
[FunctorMaterials]
[fmat]
type = PiecewiseByBlockFunctorMaterial
prop_name = 'blocks_fmat'
subdomain_to_prop_value = '0 0 1 1 2 2 3 3 4 4 5 5'
[]
[]
[Postprocessors]
[min_diff]
type = ElementExtremeValue
variable = diff
value_type = 'min'
[]
[max_diff]
type = ElementExtremeValue
variable = diff
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
[]
(test/tests/transfers/general_field/nearest_node/mesh_division/main_match_subapps.i)
# Base input for testing transfers with mesh divisions restrictions. The mesh divisions
# in the parent app will be matched with a subapp index.
# In the to_multiapp direction, the main app data at the mesh division bins of index 1-4 will
# be transferred to subapps of index 1-4 respectively
# In the from_multiapp direction, the main app fields at the mesh divisions bins of index 1-4
# will receive data (be transferred) from subapps of index 1-4 respectively
# It has the following complexities:
# - several sub-applications
# - transfers both from and to the subapps
# - both nodal and elemental variables
# Tests derived from this input may add complexities through command line arguments
[Mesh]
type = GeneratedMesh
dim = 2
nx = 4
ny = 4
[]
[MeshDivisions]
[middle]
type = CartesianGridDivision
bottom_left = '0.21 0.21 0'
# cover more and sample more bins
top_right = '1.001 1.001 0'
nx = 2
ny = 2
nz = 1
[]
[]
[AuxVariables]
[from_sub]
initial_condition = -1
[]
[from_sub_elem]
order = CONSTANT
family = MONOMIAL
initial_condition = -1
[]
[to_sub]
[InitialCondition]
type = FunctionIC
function = '1 + 2*x*x + 3*y*y*y'
[]
[]
[to_sub_elem]
order = CONSTANT
family = MONOMIAL
[InitialCondition]
type = FunctionIC
function = '2 + 2*x*x + 3*y*y*y'
[]
[]
[]
[Executioner]
type = Steady
[]
[Problem]
solve = false
[]
[Outputs]
[out]
type = Exodus
hide = 'to_sub to_sub_elem div'
overwrite = true
[]
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
app_type = MooseTestApp
input_files = sub.i
output_in_position = true
# The positions are randomly offset to prevent equi-distant nearest-locations
positions = '0.1001 0.0000013 0
0.30054 0.600001985 0
0.70021 0.4000022 0
0.800212 0.8500022 0'
# To differentiate the values received from each subapp
cli_args = 'base_value=1 base_value=2 base_value=3 base_value=4'
[]
[]
[Transfers]
[to_sub]
type = MultiAppGeneralFieldNearestLocationTransfer
to_multi_app = sub
source_variable = to_sub
variable = from_main
from_mesh_division = middle
from_mesh_division_usage = 'matching_subapp_index'
[]
[to_sub_elem]
type = MultiAppGeneralFieldNearestLocationTransfer
to_multi_app = sub
source_variable = to_sub_elem
variable = from_main_elem
from_mesh_division = middle
from_mesh_division_usage = 'matching_subapp_index'
[]
[from_sub]
type = MultiAppGeneralFieldNearestLocationTransfer
from_multi_app = sub
source_variable = to_main
variable = from_sub
to_mesh_division = middle
to_mesh_division_usage = 'matching_subapp_index'
[]
[from_sub_elem]
type = MultiAppGeneralFieldNearestLocationTransfer
from_multi_app = sub
source_variable = to_main_elem
variable = from_sub_elem
to_mesh_division = middle
to_mesh_division_usage = 'matching_subapp_index'
[]
[]
# For debugging purposes
[AuxVariables]
[div]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[mesh_div]
type = MeshDivisionAux
variable = div
mesh_division = 'middle'
[]
[]
(test/tests/transfers/general_field/shape_evaluation/mesh_division/main.i)
# Base input for testing transfers. It has the following complexities:
# - transfers both from and to the subapps
# - both nodal and elemental variables
# Tests derived from this input may add complexities through command line arguments
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[MeshDivisions]
[middle]
type = CartesianGridDivision
bottom_left = '0.01 0.01 0'
top_right = '0.81 0.81 0'
nx = 4
ny = 4
nz = 1
[]
[]
[AuxVariables]
[from_sub]
initial_condition = -1
[]
[from_sub_elem]
order = CONSTANT
family = MONOMIAL
initial_condition = -1
[]
[to_sub]
[InitialCondition]
type = FunctionIC
function = '1 + 2*x*x + 3*y*y*y'
[]
[]
[to_sub_elem]
order = CONSTANT
family = MONOMIAL
[InitialCondition]
type = FunctionIC
function = '2 + 2*x*x + 3*y*y*y'
[]
[]
[]
[Executioner]
type = Steady
[]
[Problem]
solve = false
[]
[Outputs]
[out]
type = Exodus
hide = 'to_sub to_sub_elem div'
overwrite = true
[]
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
app_type = MooseTestApp
input_files = sub.i
output_in_position = true
# we want to avoid sampling on a boundary
positions = '0.00001 0.0001 0'
cli_args = 'base_value=1'
[]
[]
[Transfers]
[to_sub]
type = MultiAppGeneralFieldShapeEvaluationTransfer
to_multi_app = sub
source_variable = to_sub
variable = from_main
# Test features non-overlapping meshes
error_on_miss = false
[]
[to_sub_elem]
type = MultiAppGeneralFieldShapeEvaluationTransfer
to_multi_app = sub
source_variable = to_sub_elem
variable = from_main_elem
# Test features non-overlapping meshes
error_on_miss = false
[]
[from_sub]
type = MultiAppGeneralFieldShapeEvaluationTransfer
from_multi_app = sub
source_variable = to_main
variable = from_sub
# Test features non-overlapping meshes
error_on_miss = false
[]
[from_sub_elem]
type = MultiAppGeneralFieldShapeEvaluationTransfer
from_multi_app = sub
source_variable = to_main_elem
variable = from_sub_elem
# Test features non-overlapping meshes
error_on_miss = false
[]
[]
# For debugging purposes
[AuxVariables]
[div]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[mesh_div]
type = MeshDivisionAux
variable = div
mesh_division = 'middle'
[]
[]
(test/tests/meshdivisions/cartesian_division.i)
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 3
dx = '1.5 2.4 0.1'
dy = '1.3 0.9'
dz = '0.4 0.5 0.6 0.7'
ix = '2 1 1'
iy = '2 3'
iz = '1 1 1 1'
[]
# To keep VPP output consistently ordered
allow_renumbering = false
[]
[MeshDivisions]
active = 'cartesian_div'
[cartesian_div]
type = CartesianGridDivision
bottom_left = '0.1 0.5 0.5'
top_right = '5 2 1'
nx = '3'
ny = '4'
nz = '1'
[]
[cartesian_div_center]
type = CartesianGridDivision
center = '2.55 1.25 0.75'
widths = '4.9 1.5 0.5'
nx = '3'
ny = '4'
nz = '1'
[]
[cartesian_div_center_pos]
type = CartesianGridDivision
center_positions = 'center'
widths = '4.9 1.5 0.5'
nx = '3'
ny = '4'
nz = '1'
[]
[]
[Positions]
[center]
type = InputPositions
positions = '2.55 1.25 0.75'
[]
[]
[AuxVariables]
[div]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[mesh_div]
type = MeshDivisionAux
variable = div
mesh_division = 'cartesian_div'
[]
[]
[VectorPostprocessors]
[div_out]
type = ElementValueSampler
variable = 'div'
sort_by = 'id'
outputs = csv
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
[]
(test/tests/meshdivisions/extra_elem_id_division.i)
[Mesh]
[fmg]
type = FileMeshGenerator
file = '../positions/depletion_id_in.e'
exodus_extra_element_integers = 'material_id pin_id assembly_id'
[]
# To keep VPP output consistently ordered
allow_renumbering = false
[]
[MeshDivisions]
[extra_id_div]
type = ExtraElementIntegerDivision
extra_id_name = 'pin_id'
[]
[]
[AuxVariables]
[div]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[mesh_div]
type = MeshDivisionAux
variable = div
mesh_division = 'extra_id_div'
[]
[]
[VectorPostprocessors]
[div_out]
type = ElementValueSampler
variable = 'div'
sort_by = 'id'
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
[]
(test/tests/transfers/general_field/shape_evaluation/mesh_division/sub.i)
base_value = 3
[Mesh]
type = GeneratedMesh
dim = 2
nx = 5
ny = 5
[]
[MeshDivisions]
[middle_sub]
type = CartesianGridDivision
# excludes the nodes on the left boundary
bottom_left = '0.0008 0.20001 0'
top_right = '0.6001 1 0'
nx = 4
ny = 4
nz = 1
[]
[]
[AuxVariables]
[from_main]
initial_condition = -1
[]
[from_main_elem]
order = CONSTANT
family = MONOMIAL
initial_condition = -1
[]
[to_main]
[InitialCondition]
type = FunctionIC
function = '${base_value} + 2*x*x + 3*y*y*y'
[]
[]
[to_main_elem]
order = CONSTANT
family = MONOMIAL
[InitialCondition]
type = FunctionIC
function = '${base_value} + 1 + 2*x*x + 3*y*y*y'
[]
[]
[]
[UserObjects]
[to_main]
type = LayeredAverage
direction = x
num_layers = 10
variable = to_main
[]
[to_main_elem]
type = LayeredAverage
direction = x
num_layers = 10
variable = to_main_elem
[]
[]
[Executioner]
type = Transient
num_steps = 1
[]
[Problem]
solve = false
[]
[Outputs]
[out]
type = Exodus
hide = 'to_main to_main_elem div'
overwrite = true
[]
[]
# For debugging purposes
[AuxVariables]
[div]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[mesh_div]
type = MeshDivisionAux
variable = div
mesh_division = 'middle_sub'
[]
[]
(test/tests/meshdivisions/cylindrical_division.i)
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 3
dx = '1.5 2.4 0.1'
dy = '1.3 0.9'
dz = '0.4 0.5 0.6 0.7'
ix = '2 1 1'
iy = '2 3'
iz = '1 1 1 1'
[]
# To keep VPP output consistently ordered
allow_renumbering = false
[]
[MeshDivisions]
active = 'cylindrical_div'
[cylindrical_div]
type = CylindricalGridDivision
axis_direction = '0 0 1'
center = '1 1 0'
azimuthal_start = '1 0 0'
# Number of bins
n_radial = 3
n_azimuthal = 4
n_axial = 8
# Extent of the cylinder
cylinder_axial_min = 0.5
cylinder_axial_max = 2
r_min = 0.5
r_max = 4
[]
[cylindrical_div_positions]
type = CylindricalGridDivision
axis_direction = '0 0 1'
center_positions = center
azimuthal_start = '1 0 0'
# Number of bins
n_radial = 3
n_azimuthal = 4
n_axial = 8
# Extent of the cylinder
cylinder_axial_min = 0.5
cylinder_axial_max = 2
r_min = 0.5
r_max = 4
[]
[]
[Positions]
[center]
type = InputPositions
positions = '1 1 0'
[]
[]
[AuxVariables]
[div]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[mesh_div]
type = MeshDivisionAux
variable = div
mesh_division = 'cylindrical_div'
[]
[]
[VectorPostprocessors]
[div_out]
type = ElementValueSampler
variable = 'div'
sort_by = 'id'
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
[]
(test/tests/meshdivisions/spherical_division.i)
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 3
dx = '1.5 2.4 0.1'
dy = '1.3 0.9'
dz = '0.4 0.5 0.6 0.7'
ix = '2 1 1'
iy = '2 3'
iz = '1 1 1 1'
[]
# To keep VPP output consistently ordered
allow_renumbering = false
[]
[MeshDivisions]
active = 'spherical_div'
[spherical_div]
type = SphericalGridDivision
center = '1 1 0'
# Number of bins
n_radial = 3
# Extent of the sphere
r_min = 0.5
r_max = 4
[]
[spherical_div_positions]
type = SphericalGridDivision
center_positions = center
# Number of bins
n_radial = 3
# Extent of the sphere
r_min = 0.5
r_max = 4
[]
[]
[Positions]
[center]
type = InputPositions
positions = '1 1 0'
[]
[]
[AuxVariables]
[div]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[mesh_div]
type = MeshDivisionAux
variable = div
mesh_division = 'spherical_div'
[]
[]
[VectorPostprocessors]
[div_out]
type = ElementValueSampler
variable = 'div'
sort_by = 'id'
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
[]