measure(const TriaAccessor<2, 2, 2> &accessor)
{
unsigned int vertex_indices[GeometryInfo<2>::vertices_per_cell];
- for (const unsigned int i : GeometryInfo<2>::vertex_indices())
+ for (const unsigned int i : accessor.vertex_indices())
vertex_indices[i] = accessor.vertex_index(i);
return GridTools::cell_measure<2>(
measure(const TriaAccessor<3, 3, 3> &accessor)
{
unsigned int vertex_indices[GeometryInfo<3>::vertices_per_cell];
- for (const unsigned int i : GeometryInfo<3>::vertex_indices())
+ for (const unsigned int i : accessor.vertex_indices())
vertex_indices[i] = accessor.vertex_index(i);
return GridTools::cell_measure<3>(
std::pair<Point<spacedim>, Point<spacedim>> boundary_points =
std::make_pair(this->vertex(0), this->vertex(0));
- for (unsigned int v = 1; v < GeometryInfo<structdim>::vertices_per_cell; ++v)
+ for (unsigned int v = 1; v < this->n_vertices(); ++v)
{
const Point<spacedim> &x = this->vertex(v);
for (unsigned int k = 0; k < spacedim; ++k)
std::array<Point<spacedim>, GeometryInfo<structdim>::vertices_per_cell> p;
std::array<double, GeometryInfo<structdim>::vertices_per_cell> w;
- for (const unsigned int i : GeometryInfo<structdim>::vertex_indices())
+ for (const unsigned int i : this->vertex_indices())
{
p[i] = this->vertex(i);
w[i] = GeometryInfo<structdim>::d_linear_shape_function(coordinates, i);
// copy vertices to avoid expensive resolution of vertex index inside loop
std::array<Point<spacedim>, GeometryInfo<structdim>::vertices_per_cell>
vertices;
- for (const unsigned int v : GeometryInfo<structdim>::vertex_indices())
+ for (const unsigned int v : this->vertex_indices())
vertices[v] = this->vertex(v);
for (unsigned int d = 0; d < spacedim; ++d)
- for (const unsigned int v : GeometryInfo<structdim>::vertex_indices())
+ for (const unsigned int v : this->vertex_indices())
for (unsigned int e = 0; e < structdim; ++e)
A[d][e] += vertices[v][d] * TransformR2UAffine<structdim>::KA[v][e];
// b = vertex * Kb
Tensor<1, spacedim> b = point;
- for (const unsigned int v : GeometryInfo<structdim>::vertex_indices())
+ for (const unsigned int v : this->vertex_indices())
b -= vertices[v] * TransformR2UAffine<structdim>::Kb[v];
DerivativeForm<1, spacedim, structdim> A_inv = A.covariant_form().transpose();
{
Assert(use_interpolation == false, ExcNotImplemented());
Point<spacedim> p;
- for (const unsigned int v : GeometryInfo<structdim>::vertex_indices())
+ for (const unsigned int v : this->vertex_indices())
p += vertex(v);
- return p / GeometryInfo<structdim>::vertices_per_cell;
+ return p / this->n_vertices();
}
else
return get_new_point_on_object(*this, use_interpolation);
Point<spacedim> maxp = this->vertex(0);
Point<spacedim> minp = this->vertex(0);
- for (unsigned int v = 1; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+ for (unsigned int v = 1; v < this->n_vertices(); ++v)
for (unsigned int d = 0; d < dim; ++d)
{
maxp[d] = std::max(maxp[d], this->vertex(v)[d]);
bool
CellAccessor<dim, spacedim>::at_boundary() const
{
- for (const auto face : GeometryInfo<dim>::face_indices())
+ for (const auto face : this->face_indices())
if (at_boundary(face))
return true;
const unsigned int i,
const TriaIterator<CellAccessor<dim, spacedim>> &pointer) const
{
- AssertIndexRange(i, GeometryInfo<dim>::faces_per_cell);
+ AssertIndexRange(i, this->n_faces());
if (pointer.state() == IteratorState::valid)
{
CellAccessor<dim, spacedim>::neighbor_of_neighbor_internal(
const unsigned int neighbor) const
{
- AssertIndexRange(neighbor, GeometryInfo<dim>::faces_per_cell);
+ AssertIndexRange(neighbor, this->n_faces());
// if we have a 1d mesh in 1d, we
// can assume that the left
const unsigned int neighbor_guess =
GeometryInfo<dim>::opposite_face[neighbor];
- if (neighbor_cell->face_index(neighbor_guess) == this_face_index)
+ if (neighbor_guess < neighbor_cell->n_faces() &&
+ neighbor_cell->face_index(neighbor_guess) == this_face_index)
return neighbor_guess;
else
// if the guess was false, then
// neighbors and find the number
// the hard way
{
- for (const unsigned int face_no : GeometryInfo<dim>::face_indices())
+ for (const unsigned int face_no : neighbor_cell->face_indices())
if (neighbor_cell->face_index(face_no) == this_face_index)
return face_no;
CellAccessor<dim, spacedim>::neighbor_of_coarser_neighbor(
const unsigned int neighbor) const
{
- AssertIndexRange(neighbor, GeometryInfo<dim>::faces_per_cell);
+ AssertIndexRange(neighbor, this->n_faces());
// make sure that the neighbor is
// on a coarser level
Assert(neighbor_is_coarser(neighbor),
// we need to loop over all faces
// and subfaces and find the
// number the hard way
- for (const unsigned int face_no : GeometryInfo<2>::face_indices())
+ for (const unsigned int face_no : neighbor_cell->face_indices())
{
if (face_no != face_no_guess)
{
// if the guess was false, then we need to loop over all faces and
// subfaces and find the number the hard way
- for (const unsigned int face_no : GeometryInfo<3>::face_indices())
+ for (const unsigned int face_no : neighbor_cell->face_indices())
{
if (face_no == face_no_guess)
continue;
*
* We decided to use the 2nd option.
*/
- AssertIndexRange(i_face, GeometryInfo<dim>::faces_per_cell);
+ AssertIndexRange(i_face, this->n_faces());
using cell_iterator = TriaIterator<CellAccessor<dim, spacedim>>;
// my_it : is the iterator to the current cell.
cell_iterator my_it(*this);
* my_face_pair : the pair reported by periodic_face_map as its first pair
* being the current cell_face.
*/
- AssertIndexRange(i_face, GeometryInfo<dim>::faces_per_cell);
+ AssertIndexRange(i_face, this->n_faces());
using cell_iterator = TriaIterator<CellAccessor<dim, spacedim>>;
cell_iterator my_it(*this);
* nb_parent_face_it: the iterator to the parent face of the periodically
* neighboring face.
*/
- AssertIndexRange(i_face, GeometryInfo<dim>::faces_per_cell);
+ AssertIndexRange(i_face, this->n_faces());
using cell_iterator = TriaIterator<CellAccessor<dim, spacedim>>;
cell_iterator my_it(*this);
const typename std::map<std::pair<cell_iterator, unsigned int>,
* iterator of the periodic neighbor of the periodic neighbor of the current
* cell.
*/
- AssertIndexRange(i_face, GeometryInfo<dim>::faces_per_cell);
+ AssertIndexRange(i_face, this->n_faces());
using cell_iterator = TriaIterator<CellAccessor<dim, spacedim>>;
const int my_face_index = this->face_index(i_face);
cell_iterator my_it(*this);
* my_face_pair : the pair reported by periodic_face_map as its first pair
* being the current cell_face.
*/
- AssertIndexRange(i_face, GeometryInfo<dim>::faces_per_cell);
+ AssertIndexRange(i_face, this->n_faces());
using cell_iterator = TriaIterator<CellAccessor<dim, spacedim>>;
cell_iterator my_it(*this);
const typename std::map<std::pair<cell_iterator, unsigned int>,
* neighbor. nb_face_pair : the pair reported by periodic_face_map as its
* first pair being the periodic neighbor cell_face.
*/
- AssertIndexRange(i_face, GeometryInfo<dim>::faces_per_cell);
+ AssertIndexRange(i_face, this->n_faces());
using cell_iterator = TriaIterator<CellAccessor<dim, spacedim>>;
cell_iterator my_it(*this);
const typename std::map<std::pair<cell_iterator, unsigned int>,
CellAccessor<dim, spacedim>::at_boundary(const unsigned int i) const
{
Assert(this->used(), TriaAccessorExceptions::ExcCellNotUsed());
- AssertIndexRange(i, GeometryInfo<dim>::faces_per_cell);
+ AssertIndexRange(i, this->n_faces());
return (neighbor_index(i) == -1);
}
return at_boundary();
else
{
- for (unsigned int l = 0; l < GeometryInfo<dim>::lines_per_cell; ++l)
+ for (unsigned int l = 0; l < this->n_lines(); ++l)
if (this->line(l)->at_boundary())
return true;