* <code>cell-@>vertex(v)</code>.
*/
virtual boost::container::small_vector<Point<spacedim>,
- GeometryInfo<dim>::vertices_per_cell>
+#ifndef _MSC_VER
+ ReferenceCell::max_n_vertices<dim>()
+#else
+ GeometryInfo<dim>::vertices_per_cell
+#endif
+ >
get_vertices(
const typename Triangulation<dim, spacedim>::cell_iterator &cell) const;
* @param[in] face_no The number of the face within the cell.
*/
boost::container::small_vector<Point<spacedim>,
- GeometryInfo<dim>::vertices_per_face>
+#ifndef _MSC_VER
+ ReferenceCell::max_n_vertices<dim - 1>()
+#else
+ GeometryInfo<dim - 1>::vertices_per_cell
+#endif
+ >
get_vertices(const typename Triangulation<dim, spacedim>::cell_iterator &cell,
const unsigned int face_no) const;
* that was passed at construction time.
*/
virtual boost::container::small_vector<Point<spacedim>,
- GeometryInfo<dim>::vertices_per_cell>
+#ifndef _MSC_VER
+ ReferenceCell::max_n_vertices<dim>()
+#else
+ GeometryInfo<dim>::vertices_per_cell
+#endif
+ >
get_vertices(const typename Triangulation<dim, spacedim>::cell_iterator &cell)
const override;
* addition to the geometry of the cell.
*/
virtual boost::container::small_vector<Point<spacedim>,
- GeometryInfo<dim>::vertices_per_cell>
+#ifndef _MSC_VER
+ ReferenceCell::max_n_vertices<dim>()
+#else
+ GeometryInfo<dim>::vertices_per_cell
+#endif
+ >
get_vertices(const typename Triangulation<dim, spacedim>::cell_iterator &cell)
const override;
* @copydoc Mapping::get_vertices()
*/
virtual boost::container::small_vector<Point<spacedim>,
- GeometryInfo<dim>::vertices_per_cell>
+#ifndef _MSC_VER
+ ReferenceCell::max_n_vertices<dim>()
+#else
+ GeometryInfo<dim>::vertices_per_cell
+#endif
+ >
get_vertices(const typename Triangulation<dim, spacedim>::cell_iterator &cell)
const override;
* addition to the geometry of the cell.
*/
virtual boost::container::small_vector<Point<spacedim>,
- GeometryInfo<dim>::vertices_per_cell>
+#ifndef _MSC_VER
+ ReferenceCell::max_n_vertices<dim>()
+#else
+ GeometryInfo<dim>::vertices_per_cell
+#endif
+ >
get_vertices(const typename Triangulation<dim, spacedim>::cell_iterator &cell)
const override;
unsigned int
n_vertices() const;
+ /**
+ * Return the maximum number of vertices an object of dimension `structdim`
+ * can have. This is always the number of vertices of a
+ * `structdim`-dimensional hypercube.
+ *
+ * @see ReferenceCell::max_n_faces()
+ */
+ template <int structdim>
+ static constexpr unsigned int
+ max_n_vertices();
+
/**
* Return an object that can be thought of as an array containing all
* indices from zero to n_vertices().
+template <int structdim>
+inline constexpr unsigned int
+ReferenceCell::max_n_vertices()
+{
+ return GeometryInfo<structdim>::vertices_per_cell;
+}
+
+
+
inline unsigned int
ReferenceCell::n_lines() const
{
{
// This branch should only be used after the cell vertex index cache is
// set up
- constexpr unsigned int max_vertices_per_cell = 1 << dim;
- const std::size_t my_index =
- static_cast<std::size_t>(this->present_index) * max_vertices_per_cell;
+ const auto my_index = static_cast<std::size_t>(this->present_index) *
+ ReferenceCell::max_n_vertices<dim>();
AssertIndexRange(my_index + corner,
this->tria->levels[this->present_level]
->cell_vertex_indices_cache.size());
TriaAccessor<structdim, dim, spacedim>::diameter() const
{
boost::container::small_vector<Point<spacedim>,
- GeometryInfo<structdim>::vertices_per_cell>
+# ifndef _MSC_VER
+ ReferenceCell::max_n_vertices<structdim>()
+# else
+ GeometryInfo<structdim>::vertices_per_cell
+# endif
+ >
vertices(this->n_vertices());
for (unsigned int v = 0; v < vertices.size(); ++v)
template <int dim, int spacedim>
boost::container::small_vector<Point<spacedim>,
- GeometryInfo<dim>::vertices_per_cell>
+# ifndef _MSC_VER
+ ReferenceCell::max_n_vertices<dim>()
+# else
+ GeometryInfo<dim>::vertices_per_cell
+# endif
+ >
Mapping<dim, spacedim>::get_vertices(
const typename Triangulation<dim, spacedim>::cell_iterator &cell) const
{
boost::container::small_vector<Point<spacedim>,
- GeometryInfo<dim>::vertices_per_cell>
+# ifndef _MSC_VER
+ ReferenceCell::max_n_vertices<dim>()
+# else
+ GeometryInfo<dim>::vertices_per_cell
+# endif
+ >
vertices;
for (const unsigned int i : cell->vertex_indices())
vertices.push_back(cell->vertex(i));
template <int dim, int spacedim>
boost::container::small_vector<Point<spacedim>,
- GeometryInfo<dim>::vertices_per_face>
+# ifndef _MSC_VER
+ ReferenceCell::max_n_vertices<dim - 1>()
+# else
+ GeometryInfo<dim - 1>::vertices_per_cell
+# endif
+ >
Mapping<dim, spacedim>::get_vertices(
const typename Triangulation<dim, spacedim>::cell_iterator &cell,
const unsigned int face_no) const
{
boost::container::small_vector<Point<spacedim>,
- GeometryInfo<dim>::vertices_per_face>
+# ifndef _MSC_VER
+ ReferenceCell::max_n_vertices<dim - 1>()
+# else
+ GeometryInfo<dim - 1>::vertices_per_cell
+# endif
+ >
face_vertices;
const auto &cell_vertices = get_vertices(cell);
template <int dim, int spacedim, typename VectorType>
boost::container::small_vector<Point<spacedim>,
- GeometryInfo<dim>::vertices_per_cell>
+#ifndef _MSC_VER
+ ReferenceCell::max_n_vertices<dim>()
+#else
+ GeometryInfo<dim>::vertices_per_cell
+#endif
+ >
MappingFEField<dim, spacedim, VectorType>::get_vertices(
const typename Triangulation<dim, spacedim>::cell_iterator &cell) const
{
uses_level_dofs ? *euler_vector[cell->level()] : *euler_vector[0];
boost::container::small_vector<Point<spacedim>,
- GeometryInfo<dim>::vertices_per_cell>
+#ifndef _MSC_VER
+ ReferenceCell::max_n_vertices<dim>()
+#else
+ GeometryInfo<dim>::vertices_per_cell
+#endif
+ >
vertices(cell->n_vertices());
for (unsigned int i = 0; i < dofs_per_cell; ++i)
{
AssertDimension(real_points.size(), unit_points.size());
std::vector<Point<spacedim>> support_points_higher_order;
boost::container::small_vector<Point<spacedim>,
- GeometryInfo<dim>::vertices_per_cell>
+#ifndef _MSC_VER
+ ReferenceCell::max_n_vertices<dim>()
+#else
+ GeometryInfo<dim>::vertices_per_cell
+#endif
+ >
vertices;
if (polynomial_degree == 1)
vertices = this->get_vertices(cell);
template <int dim, typename VectorType, int spacedim>
boost::container::small_vector<Point<spacedim>,
- GeometryInfo<dim>::vertices_per_cell>
+#ifndef _MSC_VER
+ ReferenceCell::max_n_vertices<dim>()
+#else
+ GeometryInfo<dim>::vertices_per_cell
+#endif
+ >
MappingQ1Eulerian<dim, VectorType, spacedim>::get_vertices(
const typename Triangulation<dim, spacedim>::cell_iterator &cell) const
{
boost::container::small_vector<Point<spacedim>,
- GeometryInfo<dim>::vertices_per_cell>
- vertices(GeometryInfo<dim>::vertices_per_cell);
+#ifndef _MSC_VER
+ ReferenceCell::max_n_vertices<dim>()
+#else
+ GeometryInfo<dim>::vertices_per_cell
+#endif
+ >
+ vertices(cell->n_vertices());
// The assertions can not be in the constructor, since this would
// require to call dof_handler.distribute_dofs(fe) *before* the mapping
// object is constructed, which is not necessarily what we want.
template <int dim, int spacedim>
boost::container::small_vector<Point<spacedim>,
- GeometryInfo<dim>::vertices_per_cell>
+#ifndef _MSC_VER
+ ReferenceCell::max_n_vertices<dim>()
+#else
+ GeometryInfo<dim>::vertices_per_cell
+#endif
+ >
MappingQCache<dim, spacedim>::get_vertices(
const typename Triangulation<dim, spacedim>::cell_iterator &cell) const
{
AssertIndexRange(cell->index(), (*support_point_cache)[cell->level()].size());
const auto ptr = (*support_point_cache)[cell->level()][cell->index()].begin();
return boost::container::small_vector<Point<spacedim>,
- GeometryInfo<dim>::vertices_per_cell>(
- ptr, ptr + cell->n_vertices());
+#ifndef _MSC_VER
+ ReferenceCell::max_n_vertices<dim>()
+#else
+ GeometryInfo<dim>::vertices_per_cell
+#endif
+ >(ptr, ptr + cell->n_vertices());
}
template <int dim, typename VectorType, int spacedim>
boost::container::small_vector<Point<spacedim>,
- GeometryInfo<dim>::vertices_per_cell>
+#ifndef _MSC_VER
+ ReferenceCell::max_n_vertices<dim>()
+#else
+ GeometryInfo<dim>::vertices_per_cell
+#endif
+ >
MappingQEulerian<dim, VectorType, spacedim>::get_vertices(
const typename Triangulation<dim, spacedim>::cell_iterator &cell) const
{
const std::vector<Point<spacedim>> a = compute_mapping_support_points(cell);
boost::container::small_vector<Point<spacedim>,
- GeometryInfo<dim>::vertices_per_cell>
- vertex_locations(a.begin(),
- a.begin() + GeometryInfo<dim>::vertices_per_cell);
+#ifndef _MSC_VER
+ ReferenceCell::max_n_vertices<dim>()
+#else
+ GeometryInfo<dim>::vertices_per_cell
+#endif
+ >
+ vertex_locations(a.begin(), a.begin() + cell->n_vertices());
return vertex_locations;
}
[[maybe_unused]] unsigned int counter = 0;
std::vector<unsigned int> key;
- key.reserve(GeometryInfo<structdim>::vertices_per_cell);
+ key.reserve(ReferenceCell::max_n_vertices<structdim>());
for (unsigned int o = 0; o < obj.n_objects(); ++o)
{
{
for (unsigned int l = 0; l < levels.size(); ++l)
{
- constexpr unsigned int max_vertices_per_cell = 1 << dim;
std::vector<unsigned int> &cache = levels[l]->cell_vertex_indices_cache;
cache.clear();
- cache.resize(levels[l]->refine_flags.size() * max_vertices_per_cell,
+ cache.resize(levels[l]->refine_flags.size() *
+ ReferenceCell::max_n_vertices<dim>(),
numbers::invalid_unsigned_int);
for (const auto &cell : cell_iterators_on_level(l))
{
- const unsigned int my_index = cell->index() * max_vertices_per_cell;
+ const unsigned int my_index =
+ cell->index() * ReferenceCell::max_n_vertices<dim>();
// to reduce the cost of this function when passing down into quads,
// then lines, then vertices, we use a more low-level access method