case 1:
return {vertices[0], vertices[1], vertices[2]};
case 3:
- return {vertices[1], vertices[2], vertices[0]};
- case 5:
return {vertices[2], vertices[0], vertices[1]};
+ case 5:
+ return {vertices[1], vertices[2], vertices[0]};
case 0:
return {vertices[0], vertices[2], vertices[1]};
case 2:
// loop over all faces (triangles) ...
for (unsigned int face_no = 0; face_no < faces.size(); ++face_no)
{
+ const ReferenceCell face_reference_cell =
+ reference_cell.face_reference_cell(face_no);
// We will use linear polynomials to map the reference quadrature
// points correctly to on faces. There are as many linear shape
// functions as there are vertices in the face.
{
const auto &face = faces[face_no];
+ // The goal of this function is to compute identical sets of
+ // quadrature points on the common face of two abutting cells. Our
+ // orientation convention is that, given such a pair of abutting
+ // cells:
+ //
+ // 1. The shared face, from the perspective of the first cell, is
+ // in the default orientation.
+ // 2. The shared face, from the perspective of the second cell, has
+ // its orientation computed relative to the first cell: i.e.,
+ // 'orientation' is the vertex permutation applied to the first
+ // cell's face to get the second cell's face.
+ //
+ // The first case is trivial since points do not need to be
+ // oriented. However, in the second case, we need to use the
+ // *reverse* of the stored orientation (i.e., the permutation
+ // applied to the second cell's face which yields the first cell's
+ // face) so that we get identical quadrature points.
+ //
+ // For more information see connectivity.h.
const boost::container::small_vector<Point<3>, 8> support_points =
- reference_cell.face_reference_cell(face_no)
- .permute_by_combined_orientation<Point<3>>(face, orientation);
+ face_reference_cell.permute_by_combined_orientation<Point<3>>(
+ face,
+ face_reference_cell.get_inverse_combined_orientation(
+ orientation));
// the quadrature rule to be projected ...
const auto &sub_quadrature_points =
#include "../tests.h"
void
-test(const unsigned int orientation)
+test(const unsigned char orientation)
{
const unsigned int face_no = 0;
}
{
- const auto &face = dummy.begin()->face(face_no);
+ const auto &face = dummy.begin()->face(face_no);
+ const auto face_reference_cell = face->reference_cell();
const auto permuted =
- ReferenceCell(ReferenceCells::Triangle)
- .permute_according_orientation(std::array<unsigned int, 3>{{0, 1, 2}},
- orientation);
+ ReferenceCells::Triangle.permute_according_orientation(
+ std::array<unsigned int, 3>{{0, 1, 2}}, orientation);
auto direction =
cross_product_3d(vertices[permuted[1]] - vertices[permuted[0]],
vertices.push_back(face->center() + direction);
CellData<3> cell;
- cell.vertices.resize(4);
-
- cell.vertices[permuted[0]] = face->vertex_index(0);
- cell.vertices[permuted[1]] = face->vertex_index(1);
- cell.vertices[permuted[2]] = face->vertex_index(2);
- cell.vertices[3] = 4;
-
+ cell.vertices = {face->vertex_index(permuted[0]),
+ face->vertex_index(permuted[1]),
+ face->vertex_index(permuted[2]),
+ 4};
cell.material_id = 1;
cells.push_back(cell);
}
cell++;
// check orientation
- deallog << "face orientation: " << orientation << ' '
+ deallog << "face orientation: " << int(orientation) << ' '
<< int(cell->combined_face_orientation(0)) << ' ' << std::endl;
// check vertices