11 return std::make_pair(std::min(edge.first, edge.second),
12 std::max(edge.first, edge.second));
21 const int e =
static_cast<int>(edge_index);
22 const int num_verts =
static_cast<int>(vertex_ids.size());
24 int next_v = (e < (num_verts-1)) ? e+1 : 0;
25 uint64_t v0_id = vertex_ids[e];
26 uint64_t v1_id = vertex_ids[next_v];
28 return std::make_pair(v0_id,v1_id);
37 auto& v0 = grid.
vertices[edge.first];
38 auto& v1 = grid.
vertices[edge.second];
47 const std::vector<uint64_t> &vertex_ids,
51 cell.
faces_.reserve(vertex_ids.size());
59 size_t num_verts = vertex_ids.size();
60 for (
size_t v=0; v<num_verts; ++v)
62 size_t v1_ref = (v < (num_verts-1))? v+1 : 0;
67 const auto& v0 = mesh.
vertices[v0id];
68 const auto& v1 = mesh.
vertices[v1id];
77 cell.
faces_.push_back(face);
88 const bool check_convexity)
95 for (
size_t e=0; e<num_edges; ++e)
99 const auto& v1 = mesh.
vertices[edge.first];
100 const auto& v2 = mesh.
vertices[edge.second];
105 if (v01.Cross(v02).Dot(khat)<0.0)
Normal normal_
A list of the vertices.
std::vector< uint64_t > vertex_ids_
Vertex centroid_
The face centroid.
std::vector< CellFace > faces_
std::vector< uint64_t > vertex_ids_
void PopulatePolygonFromVertices(const MeshContinuum &mesh, const std::vector< uint64_t > &vertex_ids, chi_mesh::Cell &cell)
Edge MakeUniqueEdge(const Edge &edge)
Edge MakeEdgeFromPolygonEdgeIndex(const std::vector< uint64_t > &vertex_ids, size_t edge_index)
bool CheckPolygonQuality(const MeshContinuum &mesh, const chi_mesh::Cell &cell, bool check_convexity=false)
chi_mesh::Vector3 GetEdgeCentroid(const Edge &edge, const chi_mesh::MeshContinuum &grid)
std::pair< uint64_t, uint64_t > Edge
Vector3 Cross(const Vector3 &that) const