return this->tria->levels[this->present_level]
->reference_cell[this->present_index];
else
- return this->tria->faces->quad_reference_cell[this->present_index];
+ return this->tria->faces->get_quad_type(this->present_index);
}
std::vector<unsigned char> quads_line_orientations;
/**
- * Reference cell type of each quad.
+ * Whether or not each quad is a Quadrilateral. Since, if dim = 3, faces
+ * are either Triangles or Quadrilaterals, it suffices to store a
+ * boolean.
*
* @note Used only for dim=3.
*/
- std::vector<dealii::ReferenceCell> quad_reference_cell;
+ std::vector<bool> quad_is_quadrilateral;
+
+ /**
+ * Helper accessor function for quad_is_quadrilateral
+ */
+ dealii::ReferenceCell
+ get_quad_type(const std::size_t index) const;
+
+ /**
+ * Helper accessor function for quad_is_quadrilateral
+ */
+ void
+ set_quad_type(const std::size_t index,
+ const dealii::ReferenceCell face_type);
/**
* The TriaObject containing the data of lines.
+ inline dealii::ReferenceCell
+ TriaFaces::get_quad_type(const std::size_t index) const
+ {
+ AssertIndexRange(index, quad_is_quadrilateral.size());
+ return quad_is_quadrilateral[index] ? ReferenceCells::Quadrilateral :
+ ReferenceCells::Triangle;
+ }
+
+
+
+ inline void
+ TriaFaces::set_quad_type(const std::size_t index,
+ const dealii::ReferenceCell face_type)
+ {
+ AssertIndexRange(index, quad_is_quadrilateral.size());
+ Assert(face_type == ReferenceCells::Quadrilateral ||
+ face_type == ReferenceCells::Triangle,
+ ExcInternalError());
+ if (face_type == ReferenceCells::Quadrilateral)
+ quad_is_quadrilateral[index] = true;
+ else
+ quad_is_quadrilateral[index] = false;
+ }
+
+
+
template <class Archive>
void
TriaFaces::serialize(Archive &ar, const unsigned int)
{
ar &dim;
- ar &quads &lines &quads_line_orientations &quad_reference_cell;
+ ar &quads &lines &quads_line_orientations &quad_is_quadrilateral;
}
} // namespace TriangulationImplementation
} // namespace internal
tria_faces.quads_line_orientations.size(),
1u);
- tria_faces.quad_reference_cell.reserve(new_size);
- tria_faces.quad_reference_cell.insert(
- tria_faces.quad_reference_cell.end(),
- new_size - tria_faces.quad_reference_cell.size(),
- dealii::ReferenceCells::Quadrilateral);
+ auto &q_is_q = tria_faces.quad_is_quadrilateral;
+ q_is_q.reserve(new_size);
+ q_is_q.insert(q_is_q.end(), new_size - q_is_q.size(), true);
}
}
for (unsigned int q = 0, k = 0; q < n_quads; ++q)
{
// set entity type of quads
- faces.quad_reference_cell[q] = connectivity.entity_types(2)[q];
+ faces.set_quad_type(q, connectivity.entity_types(2)[q]);
// loop over all its lines
for (unsigned int i = crs.ptr[q], j = 0; i < crs.ptr[q + 1];
if (dim == 3 && structdim == 2)
{
// quad entity types
- faces.quad_reference_cell.assign(size,
- dealii::ReferenceCells::Invalid);
+ faces.quad_is_quadrilateral.assign(size, true);
// quad line orientations
faces.quads_line_orientations.assign(size * max_faces_per_cell, -1);
// TODO: we assume here that all children have the same type
// as the parent
- triangulation.faces->quad_reference_cell[new_quad->index()] =
- reference_face_type;
+ triangulation.faces->set_quad_type(new_quad->index(),
+ reference_face_type);
if (reference_face_type == ReferenceCells::Triangle)
new_quad->set_bounding_object_indices(
// TODO: faces of children have the same type as the faces
// of the parent
- triangulation.faces
- ->quad_reference_cell[new_quad->index()] =
- (reference_cell_type == ReferenceCells::Hexahedron) ?
- ReferenceCells::Quadrilateral :
- ReferenceCells::Triangle;
+ triangulation.faces->set_quad_type(
+ new_quad->index(),
+ reference_cell_type.face_reference_cell(0));
AssertIsNotUsed(new_quad);
new_quad->set_used_flag();
if (dim == 3)
return (MemoryConsumption::memory_consumption(quads) +
MemoryConsumption::memory_consumption(quads_line_orientations) +
- MemoryConsumption::memory_consumption(quad_reference_cell) +
+ MemoryConsumption::memory_consumption(quad_is_quadrilateral) +
MemoryConsumption::memory_consumption(lines));
return 0;