Chi-Tech
chi_mesh::SurfaceMesh Class Reference

#include <chi_surfacemesh.h>

Public Member Functions

const std::vector< chi_mesh::Vertex > & GetVertices () const
 
const std::vector< chi_mesh::Face > & GetTriangles () const
 
const std::vector< chi_mesh::PolyFace * > & GetPolygons () const
 
 SurfaceMesh ()
 
 ~SurfaceMesh ()
 
int ImportFromOBJFile (const std::string &fileName, bool as_poly=false, const chi_mesh::Vector3 &transform=Vector3(0, 0, 0))
 
int ImportFromTriangleFiles (const char *fileName, bool as_poly)
 
int ImportFromMshFiles (const char *fileName, bool as_poly)
 
void ExportToOBJFile (const char *fileName)
 
void ExportToPolyFile (const char *fileName)
 
void UpdateInternalConnectivity ()
 
bool CheckNegativeSense (double x, double y, double z)
 
void SplitByPatch (std::vector< chi_mesh::SurfaceMesh * > &patches)
 
void ExtractOpenEdgesToObj (const char *fileName)
 
void CheckCyclicDependencies (int num_angles)
 
void GetMeshStats ()
 
void ComputeLoadBalancing (std::vector< double > &x_cuts, std::vector< double > &y_cuts)
 

Static Public Member Functions

static SurfaceMeshCreateFromDivisions (std::vector< double > &vertices_1d_x, std::vector< double > &vertices_1d_y)
 

Protected Attributes

std::vector< chi_mesh::Vertexvertices_
 
std::vector< chi_mesh::Vertextex_vertices_
 Texture vertices. More...
 
std::vector< chi_mesh::Normalnormals_
 
std::vector< chi_mesh::Facefaces_
 
std::vector< chi_mesh::Edgelines_
 
std::vector< chi_mesh::PolyFace * > poly_faces_
 Polygonal faces. More...
 
std::vector< int > physical_region_map_
 

Friends

std::ostream & operator<< (std::ostream &os, SurfaceMesh &dt)
 

Detailed Description

Generic surface mesh class. This class facilitates many functions within the mesh environment including logically determining volumes.

Definition at line 13 of file chi_surfacemesh.h.

Constructor & Destructor Documentation

◆ SurfaceMesh()

chi_mesh::SurfaceMesh::SurfaceMesh ( )

Default constructor.

Definition at line 5 of file chi_surfacemesh_constrdestr.cc.

◆ ~SurfaceMesh()

chi_mesh::SurfaceMesh::~SurfaceMesh ( )

Default destructor.

Definition at line 12 of file chi_surfacemesh_constrdestr.cc.

Member Function Documentation

◆ CheckCyclicDependencies()

void chi_mesh::SurfaceMesh::CheckCyclicDependencies ( int  num_angles)

Checks for cyclic dependencies in this mesh. Transport type sweeps have a step where the inter-cell dependency is acyclically sorted. This step is repeated here.

Definition at line 14 of file chi_surfacemesh_meshstats.cc.

◆ CheckNegativeSense()

bool chi_mesh::SurfaceMesh::CheckNegativeSense ( double  x,
double  y,
double  z 
)

Definition at line 4 of file chi_surfacemesh_checksense.cc.

◆ ComputeLoadBalancing()

void chi_mesh::SurfaceMesh::ComputeLoadBalancing ( std::vector< double > &  x_cuts,
std::vector< double > &  y_cuts 
)

Computes load balancing parameters from a set of predictive cuts. Does not actually perform these cuts.

Definition at line 186 of file chi_surfacemesh_meshstats.cc.

◆ CreateFromDivisions()

chi_mesh::SurfaceMesh * chi_mesh::SurfaceMesh::CreateFromDivisions ( std::vector< double > &  vertices_1d_x,
std::vector< double > &  vertices_1d_y 
)
static

Creates a 2D orthogonal mesh from a set of vertices in x and y. The vertices along a dimension merely represents the divisions. They are not the complete vertices defining a cell. For example:

std::vector<chi_mesh::Vertex> vertices_x = {0.0,1.0,2.0};
std::vector<chi_mesh::Vertex> vertices_y = {0.0,1.0,2.0};
static SurfaceMesh * CreateFromDivisions(std::vector< double > &vertices_1d_x, std::vector< double > &vertices_1d_y)

This code will create a 2x2 mesh with $ \vec{x} \in [0,2]^2 $.

Definition at line 559 of file chi_surfacemesh_loadexport.cc.

◆ ExportToOBJFile()

void chi_mesh::SurfaceMesh::ExportToOBJFile ( const char *  fileName)

Exports the triangular faces of a surface mesh to wavefront .obj files.

Definition at line 864 of file chi_surfacemesh_loadexport.cc.

◆ ExportToPolyFile()

void chi_mesh::SurfaceMesh::ExportToPolyFile ( const char *  fileName)

Exports a PSLG to triangle1.6's .poly format.

Definition at line 939 of file chi_surfacemesh_loadexport.cc.

◆ ExtractOpenEdgesToObj()

void chi_mesh::SurfaceMesh::ExtractOpenEdgesToObj ( const char *  fileName)

Extract open edges to wavefront obj format.

Definition at line 11 of file chi_surfacemesh_extractopenedges.cc.

◆ GetMeshStats()

void chi_mesh::SurfaceMesh::GetMeshStats ( )

Gets simple mesh statistics.

Definition at line 101 of file chi_surfacemesh_meshstats.cc.

◆ GetPolygons()

const std::vector< chi_mesh::PolyFace * > & chi_mesh::SurfaceMesh::GetPolygons ( ) const
inline

Definition at line 33 of file chi_surfacemesh.h.

◆ GetTriangles()

const std::vector< chi_mesh::Face > & chi_mesh::SurfaceMesh::GetTriangles ( ) const
inline

Definition at line 30 of file chi_surfacemesh.h.

◆ GetVertices()

const std::vector< chi_mesh::Vertex > & chi_mesh::SurfaceMesh::GetVertices ( ) const
inline

Definition at line 27 of file chi_surfacemesh.h.

◆ ImportFromMshFiles()

int chi_mesh::SurfaceMesh::ImportFromMshFiles ( const char *  fileName,
bool  as_poly = false 
)

Loads a surface mesh from gmsh's file format.

Definition at line 667 of file chi_surfacemesh_loadexport.cc.

◆ ImportFromOBJFile()

int chi_mesh::SurfaceMesh::ImportFromOBJFile ( const std::string &  fileName,
bool  as_poly = false,
const chi_mesh::Vector3 transform = Vector3(0,0,0) 
)

Loads a surface mesh from a wavefront .obj file.

Definition at line 13 of file chi_surfacemesh_loadexport.cc.

◆ ImportFromTriangleFiles()

int chi_mesh::SurfaceMesh::ImportFromTriangleFiles ( const char *  fileName,
bool  as_poly = false 
)

Loads a surface mesh from triangle's file format.

Definition at line 395 of file chi_surfacemesh_loadexport.cc.

◆ SplitByPatch()

void chi_mesh::SurfaceMesh::SplitByPatch ( std::vector< chi_mesh::SurfaceMesh * > &  patches)

Splits the surface by patch.

Definition at line 4 of file chi_surfacemesh_splitbypatch.cc.

◆ UpdateInternalConnectivity()

void chi_mesh::SurfaceMesh::UpdateInternalConnectivity ( )

Runs over the faces of the surfacemesh and determines neighbors. The algorithm first establishes which cells subscribe to each vertex and then loops over faces and edges. For each edge, only the subscribing faces are searched for neighbors. This routine has time complexity O(N).

Definition at line 16 of file chi_surfacemesh_internalconn.cc.

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
chi_mesh::SurfaceMesh that 
)
friend

Definition at line 23 of file chi_surfacemesh_constrdestr.cc.

Field Documentation

◆ faces_

std::vector<chi_mesh::Face> chi_mesh::SurfaceMesh::faces_
protected

Definition at line 19 of file chi_surfacemesh.h.

◆ lines_

std::vector<chi_mesh::Edge> chi_mesh::SurfaceMesh::lines_
protected

Definition at line 20 of file chi_surfacemesh.h.

◆ normals_

std::vector<chi_mesh::Normal> chi_mesh::SurfaceMesh::normals_
protected

Definition at line 18 of file chi_surfacemesh.h.

◆ physical_region_map_

std::vector<int> chi_mesh::SurfaceMesh::physical_region_map_
protected

Definition at line 23 of file chi_surfacemesh.h.

◆ poly_faces_

std::vector<chi_mesh::PolyFace*> chi_mesh::SurfaceMesh::poly_faces_
protected

Polygonal faces.

Definition at line 21 of file chi_surfacemesh.h.

◆ tex_vertices_

std::vector<chi_mesh::Vertex> chi_mesh::SurfaceMesh::tex_vertices_
protected

Texture vertices.

Definition at line 17 of file chi_surfacemesh.h.

◆ vertices_

std::vector<chi_mesh::Vertex> chi_mesh::SurfaceMesh::vertices_
protected

Definition at line 16 of file chi_surfacemesh.h.


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