11 uint64_t partition_id,
12 const std::vector<chi_mesh::Vector3>& vertices)
14 auto cell = std::make_unique<chi_mesh::Cell>(raw_cell.
type, raw_cell.
sub_type);
16 cell->global_id_ = global_id;
17 cell->partition_id_ = partition_id;
22 size_t face_counter = 0;
23 for (
auto& raw_face : raw_cell.
faces)
33 vfc = vfc + vertices[fvid];
41 if (face_counter == 0)
53 auto vec_vvc = vertices[fvid] - newFace.
centroid_;
64 const size_t num_face_verts = newFace.
vertex_ids_.size();
65 double total_area = 0.0;
66 for (
size_t fv=0; fv<num_face_verts; ++fv)
68 size_t fvp1 = (fv < (num_face_verts-1))? fv+1 : 0;
73 auto leg_m = vertices[fvid_m] - newFace.
centroid_;
74 auto leg_p = vertices[fvid_p] - newFace.
centroid_;
76 auto vn = leg_m.
Cross(leg_p);
78 double area = 0.5*vn.
Norm();
88 cell->faces_.push_back(newFace);
Normal normal_
A list of the vertices.
bool has_neighbor_
Flag indicating whether face has a neighbor.
uint64_t neighbor_id_
Otherwise contains boundary_id.
std::vector< uint64_t > vertex_ids_
Vertex centroid_
The face centroid.
static std::unique_ptr< chi_mesh::Cell > MakeCell(const chi_mesh::UnpartitionedMesh::LightWeightCell &raw_cell, uint64_t global_id, uint64_t partition_id, const std::vector< chi_mesh::Vector3 > &vertices)
std::vector< uint64_t > vertex_ids
const chi_mesh::CellType sub_type
chi_mesh::Vertex centroid
const chi_mesh::CellType type
std::vector< LightWeightFace > faces
Vector3 Cross(const Vector3 &that) const
Vector3 Normalized() const