SemiDiscreteOT 1.0
Semi-Discrete Optimal Transport Library
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
MeshHierarchy::MeshHierarchyManager Class Reference

Class to manage a hierarchy of meshes with different resolutions. More...

#include <MeshHierarchy.h>

Public Member Functions

 MeshHierarchyManager (int min_vertices=1000, int max_vertices=10000)
 Constructor.
 
int generateHierarchyFromFile (const std::string &input_mesh_file, const std::string &output_dir, bool fill_volume=true)
 Generate hierarchy of meshes from input mesh file.
 
void setMaxVertices (int max_vertices)
 Set the maximum number of vertices for level 1.
 
void setMinVertices (int min_vertices)
 Set the minimum number of vertices for coarsest level.
 
int getNumLevels () const
 Get the number of levels in the last generated hierarchy.
 

Private Member Functions

void initializeGeogram ()
 Initialize Geogram if not already initialized.
 
bool loadVolumeMesh (const std::string &filename, GEO::Mesh &M, bool fill_volume) const
 Load a volume mesh from file.
 
int getPointsForLevel (int base_points, int level) const
 Calculate number of points for a given level.
 
void ensureDirectoryExists (const std::string &path) const
 Ensure directory exists, create if it doesn't.
 

Private Attributes

int min_vertices_
 
int max_vertices_
 
int num_levels_
 
bool is_initialized_
 

Detailed Description

Class to manage a hierarchy of meshes with different resolutions.

Definition at line 13 of file MeshHierarchy.h.

Constructor & Destructor Documentation

◆ MeshHierarchyManager()

MeshHierarchy::MeshHierarchyManager::MeshHierarchyManager ( int  min_vertices = 1000,
int  max_vertices = 10000 
)

Constructor.

Parameters
min_verticesMinimum number of vertices for the coarsest level
max_verticesMaximum number of vertices for level 1 mesh

Definition at line 16 of file MeshHierarchy.cc.

Member Function Documentation

◆ generateHierarchyFromFile()

int MeshHierarchy::MeshHierarchyManager::generateHierarchyFromFile ( const std::string &  input_mesh_file,
const std::string &  output_dir,
bool  fill_volume = true 
)

Generate hierarchy of meshes from input mesh file.

Parameters
input_mesh_filePath to the input mesh file
output_dirDirectory to save the mesh hierarchy
fill_volumeWhether to fill volume with tetrahedra (true for 3D, false for 2D surface meshes)
Returns
Number of levels generated
Exceptions
std::runtime_errorif mesh loading or processing fails

Definition at line 112 of file MeshHierarchy.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setMaxVertices()

void MeshHierarchy::MeshHierarchyManager::setMaxVertices ( int  max_vertices)

Set the maximum number of vertices for level 1.

Definition at line 79 of file MeshHierarchy.cc.

◆ setMinVertices()

void MeshHierarchy::MeshHierarchyManager::setMinVertices ( int  min_vertices)

Set the minimum number of vertices for coarsest level.

Definition at line 83 of file MeshHierarchy.cc.

◆ getNumLevels()

int MeshHierarchy::MeshHierarchyManager::getNumLevels ( ) const

Get the number of levels in the last generated hierarchy.

Definition at line 87 of file MeshHierarchy.cc.

◆ initializeGeogram()

void MeshHierarchy::MeshHierarchyManager::initializeGeogram ( )
private

Initialize Geogram if not already initialized.

Definition at line 23 of file MeshHierarchy.cc.

Here is the caller graph for this function:

◆ loadVolumeMesh()

bool MeshHierarchy::MeshHierarchyManager::loadVolumeMesh ( const std::string &  filename,
GEO::Mesh &  M,
bool  fill_volume 
) const
private

Load a volume mesh from file.

Parameters
filenamePath to the mesh file
MReference to the Geogram mesh object
fill_volumeWhether to fill volume with tetrahedra (true for 3D, false for 2D surface meshes)

Definition at line 32 of file MeshHierarchy.cc.

Here is the caller graph for this function:

◆ getPointsForLevel()

int MeshHierarchy::MeshHierarchyManager::getPointsForLevel ( int  base_points,
int  level 
) const
private

Calculate number of points for a given level.

Definition at line 97 of file MeshHierarchy.cc.

Here is the caller graph for this function:

◆ ensureDirectoryExists()

void MeshHierarchy::MeshHierarchyManager::ensureDirectoryExists ( const std::string &  path) const
private

Ensure directory exists, create if it doesn't.

Definition at line 91 of file MeshHierarchy.cc.

Here is the caller graph for this function:

Member Data Documentation

◆ min_vertices_

int MeshHierarchy::MeshHierarchyManager::min_vertices_
private

Definition at line 48 of file MeshHierarchy.h.

◆ max_vertices_

int MeshHierarchy::MeshHierarchyManager::max_vertices_
private

Definition at line 49 of file MeshHierarchy.h.

◆ num_levels_

int MeshHierarchy::MeshHierarchyManager::num_levels_
private

Definition at line 50 of file MeshHierarchy.h.

◆ is_initialized_

bool MeshHierarchy::MeshHierarchyManager::is_initialized_
private

Definition at line 51 of file MeshHierarchy.h.


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