FlattenRefinementGenerator

Removes the refinement tree of an h-refined mesh, keeping only the finest elements as unrefined (level-0) elements.

Overview

The FlattenRefinementGenerator takes a mesh that has been h-refined (for example by RefineBlockGenerator or RefineSidesetGenerator) and discards its refinement tree, keeping only the finest (active) elements and turning them into ordinary, unrefined level-0 elements. The resulting mesh no longer carries any refinement pattern and can be treated as a fresh initial mesh.

When "first_order" is set to true, the flattened mesh is additionally converted to first order, equivalent to a FIRST_ORDER conversion with ElementOrderConversionGenerator. Otherwise the element order of the input mesh is preserved.

commentnote

Flattening only makes sense for a mesh that has been refined. Because the refinement tree is discarded, a locally (adaptively) refined mesh will retain the hanging nodes it had at its finest level, producing a non-conforming mesh, and null interior neighbor links. This generator is therefore only safe for uniformly refined meshes and/or meshes that happen to be conformal post-flattening.

Example Input Syntax

[Mesh<<<{"href": "../../syntax/Mesh/index.html"}>>>]
  [eg]
    type = GeneratedMeshGenerator<<<{"description": "Create a line, square, or cube mesh with uniformly spaced or biased elements.", "href": "GeneratedMeshGenerator.html"}>>>
    dim<<<{"description": "The dimension of the mesh to be generated"}>>> = 2
    nx<<<{"description": "Number of elements in the X direction"}>>> = 2
    ny<<<{"description": "Number of elements in the Y direction"}>>> = 2
  []
  # Produce an h-refined mesh that still carries its refinement tree
  [refine]
    type = RefineBlockGenerator<<<{"description": "Mesh generator which refines one or more blocks in an existing mesh", "href": "RefineBlockGenerator.html"}>>>
    input<<<{"description": "Input mesh to refine"}>>> = eg
    block<<<{"description": "The list of blocks to be refined"}>>> = '0'
    refinement<<<{"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."}>>> = '1'
  []
  # Flatten the refinement tree back into ordinary level-0 elements
  [flatten]
    type = FlattenRefinementGenerator<<<{"description": "Removes the refinement tree of an h-refined mesh, keeping only the finest elements as unrefined (level-0) elements.", "href": "FlattenRefinementGenerator.html"}>>>
    input<<<{"description": "The mesh whose refinement will be flattened"}>>> = refine
  []
[]
(moose/test/tests/meshgenerators/flatten_refinement_generator/flatten_refinement.i)

Input Parameters

  • inputThe mesh whose refinement will be flattened

    C++ Type:MeshGeneratorName

    Controllable:No

    Description:The mesh whose refinement will be flattened

Required Parameters

  • first_orderFalseWhether to also convert the flattened mesh to first-order elements. If false, the element order of the input mesh is preserved.

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Whether to also convert the flattened mesh to first-order elements. If false, the element order of the input mesh is preserved.

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