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 MeshGenerators 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).

commentnote:Mesh naming precedence

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 MeshGenerators

The most straightforward thing to do is simply to combine the output of multiple MeshGenerators 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'
  []
[]
(test/tests/meshgenerators/combiner_generator/combiner_multi_input.i)

Will generate a mesh that looks like:

2. Combine Multiple MeshGenerators AND Translate Them

It is also possible to translate (move) the input MeshGenerators 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.

commentnote

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'
  []
[]
(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'
  []
[]
(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
(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'
  []
[]
(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

  • 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>

    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.

Required Parameters

  • 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>

    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>

    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>

    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: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