Chi-Tech
chi_mesh::mesh_cutting Namespace Reference

Data Structures

struct  ECI
 

Typedefs

typedef std::pair< uint64_t, uint64_t > Edge
 

Functions

Edge MakeUniqueEdge (const Edge &edge)
 
Edge MakeEdgeFromPolygonEdgeIndex (const std::vector< uint64_t > &vertex_ids, size_t edge_index)
 
chi_mesh::Vector3 GetEdgeCentroid (const Edge &edge, const chi_mesh::MeshContinuum &grid)
 
void PopulatePolygonFromVertices (const MeshContinuum &mesh, const std::vector< uint64_t > &vertex_ids, chi_mesh::Cell &cell)
 
bool CheckPolygonQuality (const MeshContinuum &mesh, const chi_mesh::Cell &cell, bool check_convexity=false)
 
void CutPolygon (const std::vector< ECI > &cut_edges, const std::set< uint64_t > &cut_vertices, const Vector3 &plane_point, const Vector3 &plane_normal, MeshContinuum &mesh, chi_mesh::Cell &cell)
 
bool CheckPolyhedronQuality (const MeshContinuum &mesh, const chi_mesh::Cell &cell, bool check_convexity=false)
 
std::set< size_t > FindNeighborFaceIndices (const std::vector< std::vector< uint64_t > > &proxy_faces, size_t face_index)
 
std::vector< EdgeFindNonManifoldEdges (const std::vector< std::vector< uint64_t > > &proxy_faces)
 
std::vector< EdgeStitchEdgesEndToEnd (const std::vector< Edge > &edges)
 
void PopulatePolyhedronFromFaces (const MeshContinuum &mesh, const std::vector< std::vector< uint64_t > > &raw_faces, chi_mesh::Cell &cell)
 
void Cut3DCell (const std::vector< ECI > &global_cut_edges, const std::set< uint64_t > &number, const Vector3 &plane_point, const Vector3 &plane_normal, double float_compare, MeshContinuum &mesh, chi_mesh::Cell &cell, bool verbose=false)
 
void CutMeshWithPlane (MeshContinuum &mesh, const Vector3 &plane_point, const Vector3 &plane_normal, double merge_tolerance=1.0e-3, double float_compare=1.0e-10)
 

Typedef Documentation

◆ Edge

typedef std::pair<uint64_t, uint64_t> chi_mesh::mesh_cutting::Edge

Definition at line 11 of file meshcutting.h.

Function Documentation

◆ CheckPolygonQuality()

bool chi_mesh::mesh_cutting::CheckPolygonQuality ( const MeshContinuum mesh,
const chi_mesh::Cell cell,
bool  check_convexity = false 
)

Performs a quality check of a given polygon. The simple quality requirement is that, if we form a triangle with the cell-centroid and the vertices of each edge (in ccw orientation), no inverted triangles are present.

Definition at line 85 of file cutmesh_2D_utils.cc.

◆ CheckPolyhedronQuality()

bool chi_mesh::mesh_cutting::CheckPolyhedronQuality ( const MeshContinuum mesh,
const chi_mesh::Cell cell,
bool  check_convexity = false 
)

Checks the quality of a polyhedron against the following.

Take each face and form triangles using the face edges and the face centroid. Now take each triangle and form a tetrahedron with the cell-centroid as the 4th vertex. The quality requirement for this tetrahedron is that its primary face must not be inverted with respect to the cell-centroid.

Another optional requirement is that the cell must be convex. This is checked by using a face centroid CFC and any neighboring face's centroid NFC and normal, n_N. If the dot-product of (NFC-CFC) with n_N is negative, then the cell cannot be classified as convex.

Definition at line 21 of file cutmesh_3D_utils.cc.

◆ Cut3DCell()

void chi_mesh::mesh_cutting::Cut3DCell ( const std::vector< ECI > &  global_cut_edges,
const std::set< uint64_t > &  number,
const Vector3 plane_point,
const Vector3 plane_normal,
double  float_compare,
MeshContinuum mesh,
chi_mesh::Cell cell,
bool  verbose = false 
)

Utility lambda to check if a vertex is in generic set.

Utility function to check if an edge is in the "cut_edges" list.

Utility lambda to check if a vertex is in generic list.

Utility lambda to flip and edge.

Utility lambda to convert a vector of edges to a vertex list.

This lambda can be applied to uncut faces and cut-face fragments to give a collection of proxy faces.

Definition at line 14 of file cutmesh_3D_cutcell.cc.

◆ CutMeshWithPlane()

void chi_mesh::mesh_cutting::CutMeshWithPlane ( MeshContinuum mesh,
const Vector3 plane_point,
const Vector3 plane_normal,
double  merge_tolerance = 1.0e-3,
double  float_compare = 1.0e-10 
)

Cuts a mesh with a plane.

Definition at line 13 of file cutmesh_plane.cc.

◆ CutPolygon()

void chi_mesh::mesh_cutting::CutPolygon ( const std::vector< ECI > &  cut_edges,
const std::set< uint64_t > &  cut_vertices,
const Vector3 plane_point,
const Vector3 plane_normal,
MeshContinuum mesh,
chi_mesh::Cell cell 
)

Cuts a polygon.

Utility lambda to check if a vertex is in "cut_vertices" list.

Utility function to check if an edge is in the "cut_edges" list.

This lamda function starts from a current cut-edge, which is either an edge where the first vertex is cut or an edge that is cut somewhere along its length, and then follows the edges in a ccw fashion until it finds another cut. This last cut is just as either an edge cut along its length or cut at the second vertex. This then completes an edge loop that can be used to define another polygon.

Definition at line 10 of file cutmesh_2D_cutcell.cc.

◆ FindNeighborFaceIndices()

std::set< size_t > chi_mesh::mesh_cutting::FindNeighborFaceIndices ( const std::vector< std::vector< uint64_t > > &  proxy_faces,
size_t  face_index 
)

Returns the face-indices that have adjacent edges to face with index face_index.

Definition at line 84 of file cutmesh_3D_utils.cc.

◆ FindNonManifoldEdges()

std::vector< chi_mesh::mesh_cutting::Edge > chi_mesh::mesh_cutting::FindNonManifoldEdges ( const std::vector< std::vector< uint64_t > > &  proxy_faces)

Finds the non-manifold edges of a collection of faces.

Definition at line 124 of file cutmesh_3D_utils.cc.

◆ GetEdgeCentroid()

chi_mesh::Vector3 chi_mesh::mesh_cutting::GetEdgeCentroid ( const Edge edge,
const chi_mesh::MeshContinuum grid 
)

Computes the centroid of an edge.

Definition at line 33 of file cutmesh_2D_utils.cc.

◆ MakeEdgeFromPolygonEdgeIndex()

std::pair< uint64_t, uint64_t > chi_mesh::mesh_cutting::MakeEdgeFromPolygonEdgeIndex ( const std::vector< uint64_t > &  vertex_ids,
size_t  edge_index 
)

Make an edge for a polygon given its edge index.

Definition at line 17 of file cutmesh_2D_utils.cc.

◆ MakeUniqueEdge()

chi_mesh::mesh_cutting::Edge chi_mesh::mesh_cutting::MakeUniqueEdge ( const Edge edge)

Makes a unique edge from a regular edge. A unique edge is an edge with its 1st vertex-id the smallest of the two vertex-ids.

Definition at line 8 of file cutmesh_2D_utils.cc.

◆ PopulatePolygonFromVertices()

void chi_mesh::mesh_cutting::PopulatePolygonFromVertices ( const MeshContinuum mesh,
const std::vector< uint64_t > &  vertex_ids,
chi_mesh::Cell cell 
)

Definition at line 45 of file cutmesh_2D_utils.cc.

◆ PopulatePolyhedronFromFaces()

void chi_mesh::mesh_cutting::PopulatePolyhedronFromFaces ( const MeshContinuum mesh,
const std::vector< std::vector< uint64_t > > &  raw_faces,
chi_mesh::Cell cell 
)

Defines a polyhedron based only on its faces.

Lamda to add a vertex to a list.

Definition at line 235 of file cutmesh_3D_utils.cc.

◆ StitchEdgesEndToEnd()

std::vector< chi_mesh::mesh_cutting::Edge > chi_mesh::mesh_cutting::StitchEdgesEndToEnd ( const std::vector< Edge > &  edges)

Attempts to stitch edges end-to-end.

Definition at line 181 of file cutmesh_3D_utils.cc.