ConstructiveSolidGeometry

The [ConstructiveSolidGeometry] block generates a CSG model from the mesh generators in the input file and configures the JSON output. It is the input file equivalent of the --csg-only command line option, described in How to Generate a CSG Model. For a description of CSG in MOOSE and of the contents of the output file, see Constructive Solid Geometry.

Example Input Syntax


[ConstructiveSolidGeometry]
  output_file = 'my_model_csg.json'
  expand_units = false
[]

The presence of the block enables CSG-only mode, so that the mesh generators call generateCSG() instead of generate() and no finite element mesh is produced. Setting generate_csg = false keeps the block in the input file while running the input normally.

The JSON file is named by output_file. By default, it is the name of the input file with _csg appended.

All engineering units are expanded into standard CSG components before output by default. Setting expand_units = false retains them as engineering units in the output.

Command Line Precedence

Command line options take precedence over the block:

  • An output file name passed to --csg-only overrides output_file.

  • --mesh-only, --split-mesh, and --parse-neml2-only disable CSG-only mode with a warning.

  • When --csg-only is used with generate_csg = false, CSG-only mode is enabled with a message noting that the command line takes precedence. The output_file and expand_units parameters still apply.

Input Parameters

  • active__all__ If specified only the blocks named will be visited and made active

    Default:__all__

    C++ Type:std::vector<std::string>

    Controllable:No

    Description:If specified only the blocks named will be visited and made active

  • expand_unitsTrueWhether to expand all engineering units into basic CSG components before output.

    Default:True

    C++ Type:bool

    Controllable:No

    Description:Whether to expand all engineering units into basic CSG components before output.

  • generate_csgTrueWhether to generate and output the CSG representation of the mesh generators instead of the finite element mesh, then exit. Ignored when --mesh-only, --split-mesh, or --parse-neml2-only is passed on the command line.

    Default:True

    C++ Type:bool

    Controllable:No

    Description:Whether to generate and output the CSG representation of the mesh generators instead of the finite element mesh, then exit. Ignored when --mesh-only, --split-mesh, or --parse-neml2-only is passed on the command line.

  • inactiveIf specified blocks matching these identifiers will be skipped.

    C++ Type:std::vector<std::string>

    Controllable:No

    Description:If specified blocks matching these identifiers will be skipped.

  • output_fileName of the CSG JSON output file (Default: "_csg.json"). Overridden by --csg-only .

    C++ Type:std::string

    Controllable:No

    Description:Name of the CSG JSON output file (Default: "_csg.json"). Overridden by --csg-only .

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.

Advanced Parameters