Class MeshGenerator
Defined in File mesh_generator.h
Inheritance Relationships
Derived Types
public opensn::DistributedMeshGenerator
(Class DistributedMeshGenerator)public opensn::ExtruderMeshGenerator
(Class ExtruderMeshGenerator)public opensn::FromFileMeshGenerator
(Class FromFileMeshGenerator)public opensn::OrthogonalMeshGenerator
(Class OrthogonalMeshGenerator)public opensn::SplitFileMeshGenerator
(Class SplitFileMeshGenerator)
Class Documentation
-
class MeshGenerator
Mesh generation can be very complicated in parallel. Some mesh formats do not store connectivity information and therefore we have to establish connectivity after the file is read. Most mesh formats are also not partitioned for multiple processors when read/generated. The design of these types of objects need to consider the previous generation of how we did this. We had the concept of a VolumeMesher, which essentially took an
UnpartitionedMesh
and converted it into a partitioned mesh (i.e. the requiredMeshContinuum
object). Up to now we’ve really only had two variants. TheVolumeMesherPredefinedUnpartitioned
and theVolumeMesherExtruder
. Both of which operated on anUnpartitionedMesh
object. With this new design we want to unify these concepts to make them more extendable and therefore we split aMeshGenerator
’s execution into a phase that generates an unpartitioned mesh and a phase that then converts this mesh into real mesh (with both steps customizable). The phase that creates the real mesh can be hooked up to a partitioner that can also be designed to be pluggable.Subclassed by opensn::DistributedMeshGenerator, opensn::ExtruderMeshGenerator, opensn::FromFileMeshGenerator, opensn::OrthogonalMeshGenerator, opensn::SplitFileMeshGenerator
Public Functions
-
virtual std::shared_ptr<MeshContinuum> Execute()
Final execution step.
-
explicit MeshGenerator(const InputParameters ¶ms)
-
virtual ~MeshGenerator() = default
Virtual method to generate the unpartitioned mesh for the next step.
Default behavior here is to return the input umesh unaltered.
Public Static Functions
-
static InputParameters GetInputParameters()
-
static std::shared_ptr<MeshGenerator> Create(const ParameterBlock ¶ms)
Protected Functions
-
std::vector<int64_t> PartitionMesh(const UnpartitionedMesh &input_umesh, int num_partitions) const
Builds a cell-graph and executes the partitioner that assigns cell partition ids based on the supplied number of partitions.
Executes the partitioner and configures the mesh as a real mesh.
-
bool CellHasLocalScope(int location_id, const UnpartitionedMesh::LightWeightCell &lwcell, uint64_t cell_global_id, const std::vector<std::set<uint64_t>> &vertex_subscriptions, const std::vector<int64_t> &cell_partition_ids) const
Determines if a cells needs to be included as a ghost or as a local cell.
Protected Attributes
-
const double scale_
-
const bool replicated_
-
std::vector<std::shared_ptr<MeshGenerator>> inputs_
-
std::shared_ptr<GraphPartitioner> partitioner_ = nullptr
Protected Static Functions
-
static std::unique_ptr<Cell> SetupCell(const UnpartitionedMesh::LightWeightCell &raw_cell, uint64_t global_id, uint64_t partition_id)
Converts a light-weight cell to a real cell.
-
static void BroadcastPIDs(std::vector<int64_t> &cell_pids, int root, const mpi::Communicator &communicator)
Broadcasts PIDs to other locations.
-
virtual std::shared_ptr<MeshContinuum> Execute()