- inputsThe input MeshGenerators. This can either be N generators or 1 generator. If only 1 is given then 'positions' must also be given.
C++ Type:std::vector<MeshGeneratorName>
Unit:(no unit assumed)
Controllable:No
Description:The input MeshGenerators. This can either be N generators or 1 generator. If only 1 is given then 'positions' must also be given.
CombinerGenerator
Combine multiple meshes (or copies of one mesh) together into one (disjoint) mesh. Can optionally translate those meshes before combining them.
Overview
The CombinerGenerator
allows the user to combine the outputs of multiple MeshGenerator
s into a single mesh. This is somewhat similar to the StitchedMeshGenerator with the difference being that CombinerGenerator
makes no attempt to "heal" / "join" the mesh like StitchedMeshGenerator does. There CombinerGenerator
is more suited to creation of disjoint meshes (where the individual pieces are not directly tied together).
CombinerGenerator
preserves subdomain names and boundary names (node sets, side sets, and edge sets). If the corresponding IDs exist in multiple meshes, then the meshes/copies listed later in "inputs"/"positions" take precedence.
Usage
There are three main ways to use the CombinerGenerator
:
1. Combine Multiple MeshGenerator
s
The most straightforward thing to do is simply to combine the output of multiple MeshGenerator
s together into a single mesh. For example:
[Mesh]
[gen1]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
xmin = 0
xmax = 1
ymin = 0
ymax = 1
[]
[gen2]
type = GeneratedMeshGenerator
dim = 2
nx = 12
ny = 12
xmin = 2
xmax = 3
ymin = 2
ymax = 3
[]
[gen3]
type = GeneratedMeshGenerator
dim = 2
nx = 14
ny = 14
xmin = 3.5
xmax = 5
ymin = 3
ymax = 4
[]
[cmbn]
type = CombinerGenerator
inputs = 'gen1 gen2 gen3'
[]
[]
(moose/test/tests/meshgenerators/combiner_generator/combiner_multi_input.i)Will generate a mesh that looks like:
2. Combine Multiple MeshGenerator
s AND Translate Them
It is also possible to translate (move) the input MeshGenerator
s as they are combined. This is done using the positions
option which takes triplets of floating point numbers that are interpreted as displacement vectors for moving each of the input meshes.
If you specify positions
then the number of positions
must match the number of inputs
, unless only one input is specified (more on that in a moment).
[Mesh]
[gen1]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
[]
[gen2]
type = GeneratedMeshGenerator
dim = 2
nx = 12
ny = 12
[]
[gen3]
type = GeneratedMeshGenerator
dim = 2
nx = 14
ny = 14
[]
[cmbn]
type = CombinerGenerator
inputs = 'gen1 gen2 gen3'
positions = '1 0 0 2 2 2 3 0 0'
[]
[]
(moose/test/tests/meshgenerators/combiner_generator/combiner_multi_input_translate.i)Will generate a mesh that looks like:
Alternatively, the same displacement vectors can be supplied in a file with the positions_file
option. The above mesh can equivalently be generated with the following.
[Mesh]
[gen1]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
[]
[gen2]
type = GeneratedMeshGenerator
dim = 2
nx = 12
ny = 12
[]
[gen3]
type = GeneratedMeshGenerator
dim = 2
nx = 14
ny = 14
[]
[cmbn]
type = CombinerGenerator
inputs = 'gen1 gen2 gen3'
positions_file = 'positions.txt'
[]
[]
(moose/test/tests/meshgenerators/combiner_generator/combiner_multi_input_translate_from_file.i)where the positions.txt
file contains the floating point triplets.
1 0 0
2 2 2
3 0 0
(moose/test/tests/meshgenerators/combiner_generator/positions.txt)The same restrictions on positions
also apply to the number of entries in position_file
.
3. Copy a Single Input Multiple Times With Translations
The final option is to provide exactly one inputs
but specify multiple positions
. This will cause the single input to be copied multiple times with the position of each copy specified by the positions
parameter. For example
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
[]
[cmbn]
type = CombinerGenerator
inputs = 'gen'
positions = '1 0 0 2 2 2 3 0 0'
[]
[]
(moose/test/tests/meshgenerators/combiner_generator/combiner_generator.i)Will generate a mesh that looks like:
Again, the same capability can be achieved with the positions_file
option.
Input Parameters
- avoid_merging_boundariesFalseWhether to prevent merging sidesets by offsetting ids. The first mesh in the input will keep the same boundary ids, the others will have offsets. All boundary names will remain valid
Default:False
C++ Type:bool
Unit:(no unit assumed)
Controllable:No
Description:Whether to prevent merging sidesets by offsetting ids. The first mesh in the input will keep the same boundary ids, the others will have offsets. All boundary names will remain valid
- avoid_merging_subdomainsFalseWhether to prevent merging subdomains by offsetting ids. The first mesh in the input will keep the same subdomains ids, the others will have offsets. All subdomain names will remain valid
Default:False
C++ Type:bool
Unit:(no unit assumed)
Controllable:No
Description:Whether to prevent merging subdomains by offsetting ids. The first mesh in the input will keep the same subdomains ids, the others will have offsets. All subdomain names will remain valid
- positionsThe (optional) position of each given mesh. If N 'inputs' were given then this must either be left blank or N positions must be given. If 1 input was given then this MUST be provided.
C++ Type:std::vector<libMesh::Point>
Unit:(no unit assumed)
Controllable:No
Description:The (optional) position of each given mesh. If N 'inputs' were given then this must either be left blank or N positions must be given. If 1 input was given then this MUST be provided.
- positions_fileAlternative way to provide the position of each given mesh.
C++ Type:std::vector<FileName>
Unit:(no unit assumed)
Controllable:No
Description:Alternative way to provide the position of each given mesh.
Optional Parameters
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
Unit:(no unit assumed)
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
Unit:(no unit assumed)
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
Unit:(no unit assumed)
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
Unit:(no unit assumed)
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
Unit:(no unit assumed)
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
Unit:(no unit assumed)
Controllable:No
Description:Whether or not to show mesh info after generating the mesh (bounding box, element types, sidesets, nodesets, subdomains, etc)