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);
registerMooseAction("MooseApp", CSGOnlyAction, "csg_only")
std::shared_ptr< MooseMesh > & _mesh
static InputParameters validParams()
MooseApp & _app
The MOOSE application this is associated with.
const std::string & _current_task
The current action (even though we have separate instances for each action)
Outputs the Constructive Solid Geometry to file then exits.
virtual void act() override
Method to add objects to the simulation or perform other setup tasks.
static InputParameters validParams()
std::unique_ptr< CSG::CSGBase > _csg_obj
CSGOnlyAction(const InputParameters ¶ms)
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...
const std::vector< std::vector< MeshGenerator * > > & getOrderedMeshGenerators() const
void setCSGOnly()
Set whether mesh generator system is running in CSG-only mode to true.
MeshGeneratorName getFinalMeshGeneratorName() const
Get the name of the final mesh generator.
std::string getOutputFileBase(bool for_non_moose_build_output=false) const
Get the output file base name.
MeshGeneratorSystem & getMeshGeneratorSystem()
Gets the system that manages the MeshGenerators.
const InputParameters & parameters() const
Get the parameters of the object.
const std::string & name() const
Get the name of the class.
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...