33 mooseError(
"Cannot generate CSG object without a [Mesh] block in the input file");
41 for (
const auto & generator_set : ordered_mg)
42 for (
const auto & generator : generator_set)
44 auto csg_obj = generator->generateInternalCSG();
45 const auto &
name = generator->name();
48 if (
name == final_mg_name)
64 mooseError(
"Expecting final generator with name " + final_mg_name +
65 " but not found in mesh generator tree");
67 Moose::out <<
"Outputting CSGBase object for " + final_mg_name +
"\n";
69 auto csg_json =
_csg_obj->generateOutput();
77 std::ofstream csg_file;
78 csg_file.open(json_out);
79 csg_file << csg_json.dump(2);
void setCSGOnly()
Set whether mesh generator system is running in CSG-only mode to true.
const InputParameters & parameters() const
Get the parameters of the object.
std::string getOutputFileBase(bool for_non_moose_build_output=false) const
Get the output file base name.
MeshGeneratorName getFinalMeshGeneratorName() const
Get the name of the final mesh generator.
virtual void act() override
Method to add objects to the simulation or perform other setup tasks.
CSGOnlyAction(const InputParameters ¶ms)
const std::string & name() const
Get the name of the class.
static InputParameters validParams()
static InputParameters validParams()
const std::string & _current_task
The current action (even though we have separate instances for each action)
MooseApp & _app
The MOOSE application this is associated with.
void saveOutputCSGBase(const MeshGeneratorName generator_name, std::unique_ptr< CSG::CSGBase > &csg_base)
Saves the CSGBase object to the global map storage, _csg_base_output, for a particular mesh generator...
Outputs the Constructive Solid Geometry to file then exits.
std::shared_ptr< MooseMesh > & _mesh
registerMooseAction("MooseApp", CSGOnlyAction, "csg_only")
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
std::unique_ptr< CSG::CSGBase > _csg_obj
MeshGeneratorSystem & getMeshGeneratorSystem()
Gets the system that manages the MeshGenerators.
const std::vector< std::vector< MeshGenerator * > > & getOrderedMeshGenerators() const