15#include "libmesh/parallel_object.h"
16#include "libmesh/mesh_base.h"
63 const std::string & name,
85 [[nodiscard]] std::unique_ptr<libMesh::MeshBase> &
120 [[nodiscard]] std::unique_ptr<libMesh::MeshBase>
getSavedMesh(
const std::string & name);
202 std::unique_ptr<CSG::CSGBase> & csg_base);
221 std::vector<std::pair<std::string, MeshGeneratorName>>
223 const bool allow_empty =
false)
const;
246 return const_cast<MeshGenerator &
>(std::as_const(*this).getMeshGenerator(name));
CSGBase creates an internal representation of a Constructive Solid Geometry (CSG) model.
Mesh generated from parameters.
System that manages MeshGenerators.
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...
MooseApp & _app
The MooseApp that owns this system.
void addMeshGenerator(const std::string &type, const std::string &name, const InputParameters ¶ms)
Add a mesh generator that will act on the meshes in the system.
std::vector< std::string > getMeshGeneratorNames() const
Get names of all mesh generators Note: This function should be called after all mesh generators are a...
bool hasMeshGeneratorParams(const MeshGeneratorName &name) const
Whether or not we know about the parameters for a MeshGenerator with the given name.
std::vector< std::vector< MeshGenerator * > > _ordered_mesh_generators
Holds the ordered mesh generators from createMeshGeneratorOrder() until they are executed in executeM...
std::shared_ptr< MeshGenerator > createMeshGenerator(const std::string &name)
Internal method for actually constructing a mesh generator after it has been declared externally in a...
std::unique_ptr< libMesh::MeshBase > & getMeshGeneratorOutput(const MeshGeneratorName &name)
Get a reference to a pointer that will be the output of the MeshGenerator named name.
std::map< std::string, std::list< std::unique_ptr< libMesh::MeshBase > > > _mesh_generator_outputs
Holds the output for each mesh generator - including duplicates needed downstream.
std::map< std::string, std::shared_ptr< MeshGenerator > > _mesh_generators
Owning storage for mesh generators, map of name -> MeshGenerator.
std::unordered_map< std::string, std::pair< std::string, InputParameters > > _mesh_generator_params
The MeshGenerators declared using addMeshGenerator(), cleared after createMeshGenerators() Key is the...
bool hasMeshGenerator(const MeshGeneratorName &name) const
void createAddedMeshGenerators()
Creates (constructs) all of the MeshGenerators that have been declared using addMeshGenerator().
static const std::string allow_data_driven_param
The name of the boolean parameter on the MooseApp that will enable data driven generation.
std::unique_ptr< CSG::CSGBase > & getCSGBaseGeneratorOutput(const MeshGeneratorName &name)
Returns the output CSGBase object associated with a particular mesh generator name.
std::map< std::string, std::unique_ptr< libMesh::MeshBase > > _save_in_meshes
Holds the map of save in mesh -> name.
const std::vector< std::vector< MeshGenerator * > > & getOrderedMeshGenerators() const
void setCSGOnly()
Set whether mesh generator system is running in CSG-only mode to true.
const std::string & getDataDrivenGeneratorName() const
std::optional< std::string > _data_driven_generator_name
The name of the data driven generator, if any.
static std::string mainMeshGeneratorName()
The name reserved for the "main" mesh generator which is the one used for the numerical solver downst...
std::vector< std::pair< std::string, MeshGeneratorName > > getMeshGeneratorParamDependencies(const InputParameters ¶ms, const bool allow_empty=false) const
Gets the MeshGeneratorNames that are referenced in an object's parameters.
static const std::string data_driven_generator_param
The name of the string parameter that sets the data driven generator.
void executeMeshGenerators()
Execute and clear the Mesh Generators data structure.
bool appendingMeshGenerators() const
Whether or not mesh generators are currently being appended (append_mesh_generator task)
bool getCSGOnly() const
Get whether mesh generator system is running in CSG-only mode.
const MeshGenerator & appendMeshGenerator(const std::string &type, const std::string &name, InputParameters params)
Append a mesh generator that will act on the current final mesh generator in the system.
std::vector< std::string > getSavedMeshNames() const
Get all user-defined saved meshes except main and main_displaced.
bool _csg_only
Whether mesh generator system is running in CSG-only mode.
std::unique_ptr< libMesh::MeshBase > getSavedMesh(const std::string &name)
Get the saved mesh by name.
void setVerbose(const bool verbose)
Set the verbose flag.
bool hasDataDrivenAllowed() const
std::map< std::string, std::list< std::unique_ptr< CSG::CSGBase > > > _csg_base_outputs
Holds the output CSGBase object for each mesh generator - including duplicates when needed by multipl...
MeshGenerator & getMeshGeneratorInternal(const std::string &name)
Get a MeshGenerator with the name name.
const MeshGenerator & getMeshGenerator(const std::string &name) const
bool _verbose
Whether to print the names of the mesh generators being executed or not.
MeshGeneratorName getFinalMeshGeneratorName() const
Get the name of the final mesh generator.
std::string _final_generator_name
The final mesh generator name to use.
void dataDrivenError(const MeshGenerator &generator, const std::string &message) const
Reports an error with the context of the data driven parameter, coming from the generator generator w...
void createMeshGeneratorOrder()
Order all of the _mesh_generators into _ordered_mesh_generators for later execution in executeMeshGen...
MeshGenerators are objects that can modify or add to an existing mesh.
Base class for MOOSE-based applications.
Interface for objects interacting with the PerfGraph.