Chi-Tech
chi_mesh::MeshGenerator Class Reference

#include <MeshGenerator.h>

Inheritance diagram for chi_mesh::MeshGenerator:
ChiObject chi_mesh::ExtruderMeshGenerator chi_mesh::FromFileMeshGenerator chi_mesh::OrthogonalMeshGenerator chi_mesh::SplitFileMeshGenerator

Data Structures

struct  STLVertexListHelper
 
struct  VertexListHelper
 

Public Member Functions

virtual void Execute ()
 
 MeshGenerator (const chi::InputParameters &params)
 
virtual std::unique_ptr< UnpartitionedMeshGenerateUnpartitionedMesh (std::unique_ptr< UnpartitionedMesh > input_umesh)
 
- Public Member Functions inherited from ChiObject
 ChiObject ()
 
 ChiObject (const chi::InputParameters &params)
 
void SetStackID (size_t stack_id)
 
size_t StackID () const
 
virtual void PushOntoStack (std::shared_ptr< ChiObject > &new_object)
 
virtual ~ChiObject ()=default
 

Static Public Member Functions

static chi::InputParameters GetInputParameters ()
 
- Static Public Member Functions inherited from ChiObject
static chi::InputParameters GetInputParameters ()
 

Protected Member Functions

std::vector< int64_t > PartitionMesh (const UnpartitionedMesh &input_umesh, int num_partitions)
 
std::shared_ptr< MeshContinuumSetupMesh (std::unique_ptr< UnpartitionedMesh > input_umesh_ptr, const std::vector< int64_t > &cell_pids)
 
bool CellHasLocalScope (int location_id, const chi_mesh::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
 

Static Protected Member Functions

static void BroadcastPIDs (std::vector< int64_t > &cell_pids, int root, MPI_Comm communicator)
 
static std::unique_ptr< chi_mesh::CellSetupCell (const UnpartitionedMesh::LightWeightCell &raw_cell, uint64_t global_id, uint64_t partition_id, const VertexListHelper &vertices)
 
static void SetGridAttributes (chi_mesh::MeshContinuum &grid, MeshAttributes new_attribs, std::array< size_t, 3 > ortho_cells_per_dimension)
 
static void ComputeAndPrintStats (const chi_mesh::MeshContinuum &grid)
 

Protected Attributes

const double scale_
 
const bool replicated_
 
std::vector< MeshGenerator * > inputs_
 
chi::GraphPartitionerpartitioner_ = nullptr
 

Detailed Description

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 required MeshContinuum object). Up to now we've really only had two variants. The VolumeMesherPredefinedUnpartitioned and the VolumeMesherExtruder. Both of which operated on an UnpartitionedMesh object. With this new design we want to unify these concepts to make them more extendable and therefore we split a MeshGenerator'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.

Definition at line 34 of file MeshGenerator.h.

Constructor & Destructor Documentation

◆ MeshGenerator()

chi_mesh::MeshGenerator::MeshGenerator ( const chi::InputParameters params)
explicit

Definition at line 49 of file MeshGenerator.cc.

Member Function Documentation

◆ BroadcastPIDs()

void chi_mesh::MeshGenerator::BroadcastPIDs ( std::vector< int64_t > &  cell_pids,
int  root,
MPI_Comm  communicator 
)
staticprotected

Broadcasts PIDs to other locations.

Definition at line 8 of file MeshGenerator_02_utils.cc.

◆ CellHasLocalScope()

bool chi_mesh::MeshGenerator::CellHasLocalScope ( int  location_id,
const chi_mesh::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
protected

Determines if a cells needs to be included as a ghost or as a local cell.

Definition at line 35 of file MeshGenerator_02_utils.cc.

◆ ComputeAndPrintStats()

void chi_mesh::MeshGenerator::ComputeAndPrintStats ( const chi_mesh::MeshContinuum grid)
staticprotected

Definition at line 132 of file MeshGenerator.cc.

◆ Execute()

void chi_mesh::MeshGenerator::Execute ( )
virtual

Final execution step.

Reimplemented in chi_mesh::SplitFileMeshGenerator.

Definition at line 88 of file MeshGenerator.cc.

◆ GenerateUnpartitionedMesh()

std::unique_ptr< UnpartitionedMesh > chi_mesh::MeshGenerator::GenerateUnpartitionedMesh ( std::unique_ptr< UnpartitionedMesh input_umesh)
virtual

Virtual method to generate the unpartitioned mesh for the next step.

Default behavior here is to return the input umesh unaltered.

Reimplemented in chi_mesh::ExtruderMeshGenerator, chi_mesh::FromFileMeshGenerator, and chi_mesh::OrthogonalMeshGenerator.

Definition at line 81 of file MeshGenerator.cc.

◆ GetInputParameters()

chi::InputParameters chi_mesh::MeshGenerator::GetInputParameters ( )
static

Definition at line 20 of file MeshGenerator.cc.

◆ PartitionMesh()

std::vector< int64_t > chi_mesh::MeshGenerator::PartitionMesh ( const UnpartitionedMesh input_umesh,
int  num_partitions 
)
protected

Builds a cell-graph and executes the partitioner that assigns cell partition ids based on the supplied number of partitions.

Builds a cell-graph and executes the partitioner.

Definition at line 13 of file MeshGenerator_01_setupmesh.cc.

◆ SetGridAttributes()

void chi_mesh::MeshGenerator::SetGridAttributes ( chi_mesh::MeshContinuum grid,
MeshAttributes  new_attribs,
std::array< size_t, 3 >  ortho_cells_per_dimension 
)
staticprotected

Definition at line 124 of file MeshGenerator.cc.

◆ SetupCell()

std::unique_ptr< chi_mesh::Cell > chi_mesh::MeshGenerator::SetupCell ( const UnpartitionedMesh::LightWeightCell raw_cell,
uint64_t  global_id,
uint64_t  partition_id,
const VertexListHelper vertices 
)
staticprotected

Converts a light-weight cell to a real cell.

Definition at line 62 of file MeshGenerator_02_utils.cc.

◆ SetupMesh()

std::shared_ptr< MeshContinuum > chi_mesh::MeshGenerator::SetupMesh ( std::unique_ptr< UnpartitionedMesh input_umesh_ptr,
const std::vector< int64_t > &  cell_pids 
)
protected

Executes the partitioner and configures the mesh as a real mesh.

Definition at line 71 of file MeshGenerator_01_setupmesh.cc.

Field Documentation

◆ inputs_

std::vector<MeshGenerator*> chi_mesh::MeshGenerator::inputs_
protected

Definition at line 103 of file MeshGenerator.h.

◆ partitioner_

chi::GraphPartitioner* chi_mesh::MeshGenerator::partitioner_ = nullptr
protected

Definition at line 104 of file MeshGenerator.h.

◆ replicated_

const bool chi_mesh::MeshGenerator::replicated_
protected

Definition at line 102 of file MeshGenerator.h.

◆ scale_

const double chi_mesh::MeshGenerator::scale_
protected

Definition at line 101 of file MeshGenerator.h.


The documentation for this class was generated from the following files: