#include <deal.II/base/exceptions.h>
+#include <deal.II/grid/reference_cell.h>
+
#include <deal.II/lac/block_indices.h>
#include <vector>
const Conformity conformity = unknown,
const BlockIndices &block_indices = BlockIndices());
+ /**
+ * The same as above but with the difference that also the type of the
+ * underlying geometric entity can be specified.
+ */
+ FiniteElementData(const std::vector<unsigned int> &dofs_per_object,
+ const ReferenceCell::Type cell_type,
+ const unsigned int n_components,
+ const unsigned int degree,
+ const Conformity conformity = unknown,
+ const BlockIndices &block_indices = BlockIndices());
+
/**
* Number of dofs per vertex.
*/
return true;
}
+
+ /**
+ * Return reference-cell type of face @p face_no.
+ */
+ virtual ReferenceCell::Type
+ face_reference_cell_type(const unsigned int face_no) const
+ {
+ Assert(false, ExcNotImplemented());
+ (void)face_no;
+
+ return ReferenceCell::Type::Invalid;
+ }
};
* Vertex.
*/
struct Vertex : public TensorProductBase<0>
- {};
+ {
+ ReferenceCell::Type
+ face_reference_cell_type(const unsigned int face_no) const override
+ {
+ (void)face_no;
+ return ReferenceCell::Type::Invalid;
+ }
+ };
* Line.
*/
struct Line : public TensorProductBase<1>
- {};
+ {
+ ReferenceCell::Type
+ face_reference_cell_type(const unsigned int face_no) const override
+ {
+ (void)face_no;
+ return ReferenceCell::Type::Vertex;
+ }
+ };
return GeometryInfo<2>::standard_to_real_line_vertex(
vertex, line_orientation);
}
+
+ ReferenceCell::Type
+ face_reference_cell_type(const unsigned int face_no) const override
+ {
+ (void)face_no;
+ return ReferenceCell::Type::Line;
+ }
};
get_bit(face_orientation, 2),
get_bit(face_orientation, 1));
}
+
+ ReferenceCell::Type
+ face_reference_cell_type(const unsigned int face_no) const override
+ {
+ (void)face_no;
+ return ReferenceCell::Type::Quad;
+ }
};
+ /**
+ * Return for a given reference-cell type @p the right Info.
+ */
+ inline const ReferenceCell::internal::Info::Base &
+ get_cell(const ReferenceCell::Type &type)
+ {
+ static ReferenceCell::internal::Info::Base gei_invalid;
+ static ReferenceCell::internal::Info::Vertex gei_vertex;
+ static ReferenceCell::internal::Info::Line gei_line;
+ static ReferenceCell::internal::Info::Quad gei_quad;
+ static ReferenceCell::internal::Info::Hex gei_hex;
+
+ switch (type)
+ {
+ case ReferenceCell::Type::Vertex:
+ return gei_vertex;
+ case ReferenceCell::Type::Line:
+ return gei_line;
+ case ReferenceCell::Type::Quad:
+ return gei_quad;
+ case ReferenceCell::Type::Hex:
+ return gei_hex;
+ default:
+ Assert(false, StandardExceptions::ExcNotImplemented());
+ return gei_invalid;
+ }
+ }
+
+ /**
+ * Return for a given reference-cell type @p and face number @p face_no the
+ * right Info of the @p face_no-th face.
+ */
+ inline const ReferenceCell::internal::Info::Base &
+ get_face(const ReferenceCell::Type &type, const unsigned int face_no)
+ {
+ return get_cell(get_cell(type).face_reference_cell_type(face_no));
+ }
+
} // namespace Info
} // namespace internal
} // namespace ReferenceCell
const unsigned int degree,
const Conformity conformity,
const BlockIndices & block_indices)
+ : FiniteElementData(dofs_per_object,
+ dim == 0 ?
+ ReferenceCell::Type::Vertex :
+ (dim == 1 ? ReferenceCell::Type::Line :
+ (dim == 2 ? ReferenceCell::Type::Quad :
+ ReferenceCell::Type::Hex)),
+ n_components,
+ degree,
+ conformity,
+ block_indices)
+{}
+
+template <int dim>
+FiniteElementData<dim>::FiniteElementData(
+ const std::vector<unsigned int> &dofs_per_object,
+ const ReferenceCell::Type cell_type,
+ const unsigned int n_components,
+ const unsigned int degree,
+ const Conformity conformity,
+ const BlockIndices & block_indices)
: dofs_per_vertex(dofs_per_object[0])
, dofs_per_line(dofs_per_object[1])
, dofs_per_quad(dim > 1 ? dofs_per_object[2] : 0)
, dofs_per_hex(dim > 2 ? dofs_per_object[3] : 0)
- , first_line_index(GeometryInfo<dim>::vertices_per_cell * dofs_per_vertex)
- , first_quad_index(first_line_index +
- GeometryInfo<dim>::lines_per_cell * dofs_per_line)
- , first_hex_index(first_quad_index +
- GeometryInfo<dim>::quads_per_cell * dofs_per_quad)
- , first_face_line_index(GeometryInfo<dim - 1>::vertices_per_cell *
- dofs_per_vertex)
+ , first_line_index(
+ ReferenceCell::internal::Info::get_cell(cell_type).n_vertices() *
+ dofs_per_vertex)
+ , first_quad_index(
+ first_line_index +
+ ReferenceCell::internal::Info::get_cell(cell_type).n_lines() *
+ dofs_per_line)
+ , first_hex_index(
+ first_quad_index +
+ (dim == 2 ?
+ 1 :
+ (dim == 3 ?
+ ReferenceCell::internal::Info::get_cell(cell_type).n_faces() :
+ 0)) *
+ dofs_per_quad)
+ , first_face_line_index(
+ ReferenceCell::internal::Info::get_face(cell_type, 0).n_vertices() *
+ dofs_per_vertex)
, first_face_quad_index(
- (dim == 3 ? GeometryInfo<dim - 1>::vertices_per_cell * dofs_per_vertex :
- GeometryInfo<dim>::vertices_per_cell * dofs_per_vertex) +
- GeometryInfo<dim - 1>::lines_per_cell * dofs_per_line)
- , dofs_per_face(GeometryInfo<dim>::vertices_per_face * dofs_per_vertex +
- GeometryInfo<dim>::lines_per_face * dofs_per_line +
- GeometryInfo<dim>::quads_per_face * dofs_per_quad)
- , dofs_per_cell(GeometryInfo<dim>::vertices_per_cell * dofs_per_vertex +
- GeometryInfo<dim>::lines_per_cell * dofs_per_line +
- GeometryInfo<dim>::quads_per_cell * dofs_per_quad +
- GeometryInfo<dim>::hexes_per_cell * dofs_per_hex)
+ (dim == 3 ?
+ ReferenceCell::internal::Info::get_face(cell_type, 0).n_vertices() *
+ dofs_per_vertex :
+ ReferenceCell::internal::Info::get_cell(cell_type).n_vertices() *
+ dofs_per_vertex) +
+ ReferenceCell::internal::Info::get_face(cell_type, 0).n_lines() *
+ dofs_per_line)
+ , dofs_per_face(
+ ReferenceCell::internal::Info::get_face(cell_type, 0).n_vertices() *
+ dofs_per_vertex +
+ ReferenceCell::internal::Info::get_face(cell_type, 0).n_lines() *
+ dofs_per_line +
+ (dim == 3 ? 1 : 0) * dofs_per_quad)
+ , dofs_per_cell(
+ ReferenceCell::internal::Info::get_cell(cell_type).n_vertices() *
+ dofs_per_vertex +
+ ReferenceCell::internal::Info::get_cell(cell_type).n_lines() *
+ dofs_per_line +
+ (dim == 2 ?
+ 1 :
+ (dim == 3 ?
+ ReferenceCell::internal::Info::get_cell(cell_type).n_faces() :
+ 0)) *
+ dofs_per_quad +
+ (dim == 3 ? 1 : 0) * dofs_per_hex)
, components(n_components)
, degree(degree)
, conforming_space(conformity)