dof_handler);
#ifdef DEBUG
- if (q.state() != past_the_end)
+ if (q.state() != IteratorState::past_the_end)
Assert (q->used(), typename TriaAccessor<dim>::ExcUnusedCellAsChild());
#endif
return q;
dof_handler);
#ifdef DEBUG
- if (q.state() != past_the_end)
+ if (q.state() != IteratorState::past_the_end)
Assert (q->used(), typename TriaAccessor<dim>::ExcUnusedCellAsChild());
#endif
return q;
dof_handler);
#ifdef DEBUG
- if (q.state() != past_the_end)
+ if (q.state() != IteratorState::past_the_end)
Assert (q->used(), typename TriaAccessor<dim>::ExcUnusedCellAsChild());
#endif
return q;
dof_handler);
#ifdef DEBUG
- if (q.state() != past_the_end)
+ if (q.state() != IteratorState::past_the_end)
Assert (q->used(), typename TriaAccessor<dim>::ExcUnusedCellAsNeighbor());
#endif
return q;
dof_handler);
#ifdef DEBUG
- if (q.state() != past_the_end)
+ if (q.state() != IteratorState::past_the_end)
Assert (q->used(), typename TriaAccessor<dim>::ExcUnusedCellAsChild());
#endif
return q;
* present level.
*/
int index () const;
+
/**
* Return the state of the iterator.
* For the different states an accessor
* can be in, refer to the
* @ref{TriaRawIterator} documentation.
*/
- IteratorState state () const;
+ IteratorState::IteratorState state () const;
/**
* Return a pointer to the triangulation
template <int dim>
inline
-IteratorState
+IteratorState::IteratorState
TriaAccessor<dim>::state () const
{
if ((present_level>=0) && (present_index>=0))
- return valid;
+ return IteratorState::valid;
else
if ((present_level==-1) && (present_index==-1))
- return past_the_end;
+ return IteratorState::past_the_end;
else
- return invalid;
+ return IteratorState::invalid;
};
bool
TriaObjectAccessor<1,dim>::used () const
{
- Assert (state() == valid,
+ Assert (state() == IteratorState::valid,
typename TriaAccessor<dim>::ExcDereferenceInvalidObject());
return tria->levels[present_level]->lines.used[present_index];
};
TriaIterator<dim,TriaObjectAccessor<1,dim> >
q (tria, present_level+1, child_index (i));
- Assert ((q.state() == past_the_end) || q->used(),
+ Assert ((q.state() == IteratorState::past_the_end) || q->used(),
typename TriaAccessor<dim>::ExcUnusedCellAsChild());
return q;
bool
TriaObjectAccessor<1,dim>::has_children () const
{
- Assert (state() == valid,
+ Assert (state() == IteratorState::valid,
typename TriaAccessor<dim>::ExcDereferenceInvalidObject());
return (tria->levels[present_level]->lines.children[present_index] != -1);
}
bool
TriaObjectAccessor<2,dim>::used () const
{
- Assert (state() == valid,
+ Assert (state() == IteratorState::valid,
typename TriaAccessor<dim>::ExcDereferenceInvalidObject());
return tria->levels[present_level]->quads.used[present_index];
};
TriaIterator<dim,TriaObjectAccessor<2,dim> >
q (tria, present_level+1, child_index (i));
- Assert ((q.state() == past_the_end) || q->used(),
+ Assert ((q.state() == IteratorState::past_the_end) || q->used(),
typename TriaAccessor<dim>::ExcUnusedCellAsChild());
return q;
bool
TriaObjectAccessor<2,dim>::has_children () const
{
- Assert (state() == valid,
+ Assert (state() == IteratorState::valid,
typename TriaAccessor<dim>::ExcDereferenceInvalidObject());
return (tria->levels[present_level]->quads.children[present_index] != -1);
};
bool
TriaObjectAccessor<3,dim>::used () const
{
- Assert (state() == valid,
+ Assert (state() == IteratorState::valid,
typename TriaAccessor<dim>::ExcDereferenceInvalidObject());
return tria->levels[present_level]->hexes.used[present_index];
};
TriaIterator<dim,TriaObjectAccessor<3,dim> > q (tria, present_level+1, child_index (i));
- Assert ((q.state() == past_the_end) || q->used(),
+ Assert ((q.state() == IteratorState::past_the_end) || q->used(),
typename TriaAccessor<dim>::ExcUnusedCellAsChild());
return q;
template <int dim>
bool TriaObjectAccessor<3,dim>::has_children () const
{
- Assert (state() == valid,
+ Assert (state() == IteratorState::valid,
typename TriaAccessor<dim>::ExcDereferenceInvalidObject());
return (tria->levels[present_level]->hexes.children[present_index] != -1);
};
bool
TriaObjectAccessor<celldim,dim>::used () const
{
- Assert (state() == valid, ExcDereferenceInvalidObject());
+ Assert (state() == IteratorState::valid, ExcDereferenceInvalidObject());
return tria->levels[present_level]->hexes.used[present_index];
};
TriaIterator<dim,TriaObjectAccessor<celldim,dim> >
q (tria, present_level+1, child_index (i));
- Assert ((q.state() == past_the_end) || q->used(),
+ Assert ((q.state() == IteratorState::past_the_end) || q->used(),
ExcUnusedCellAsChild());
return q;
template<int celldim, int dim>
bool TriaObjectAccessor<celldim,dim>::has_children () const
{
- Assert (state() == valid,
+ Assert (state() == IteratorState::valid,
typename TriaAccessor<dim>::ExcDereferenceInvalidObject());
return (tria->levels[present_level]->hexes.children[present_index] != -1);
};
TriaIterator<dim,CellAccessor<dim> >
q (tria, neighbor_level (i), neighbor_index (i));
- Assert ((q.state() == past_the_end) || q->used(),
+ Assert ((q.state() == IteratorState::past_the_end) || q->used(),
typename TriaAccessor<dim>::ExcUnusedCellAsNeighbor());
return q;
TriaIterator<dim,CellAccessor<dim> >
q (tria, present_level+1, child_index (i));
- Assert ((q.state() == past_the_end) || q->used(),
+ Assert ((q.state() == IteratorState::past_the_end) || q->used(),
typename TriaAccessor<dim>::ExcUnusedCellAsChild());
return q;
/**
* Return the state of the iterator.
*/
- IteratorState state () const;
+ IteratorState::IteratorState state () const;
/**
* Print the iterator to @p{out}. The
const Accessor &
TriaRawIterator<dim,Accessor>::operator * () const
{
- Assert (state() == valid, ExcDereferenceInvalidObject());
+ Assert (state() == IteratorState::valid, ExcDereferenceInvalidObject());
return accessor;
};
Accessor &
TriaRawIterator<dim,Accessor>::operator * ()
{
- Assert (state() == valid, ExcDereferenceInvalidObject());
+ Assert (state() == IteratorState::valid, ExcDereferenceInvalidObject());
return accessor;
};
template <int dim, typename Accessor>
inline
-IteratorState
+IteratorState::IteratorState
TriaRawIterator<dim,Accessor>::state () const
{
return accessor.state ();
bool
TriaRawIterator<dim,Accessor>::operator < (const TriaRawIterator &i) const
{
- Assert (state() != invalid, ExcDereferenceInvalidObject());
- Assert (i.state() != invalid, ExcDereferenceInvalidObject());
+ Assert (state() != IteratorState::invalid, ExcDereferenceInvalidObject());
+ Assert (i.state() != IteratorState::invalid, ExcDereferenceInvalidObject());
Assert (&accessor.get_triangulation() == &i.accessor.get_triangulation(),
ExcInvalidComparison());
return ((((accessor.level() < i.accessor.level()) ||
((accessor.level() == i.accessor.level()) &&
(accessor.index() < i.accessor.index())) ) &&
- (state()==valid) &&
- (i.state()==valid) ) ||
- ((state()==valid) && (i.state()==past_the_end)));
+ (state()==IteratorState::valid) &&
+ (i.state()==IteratorState::valid) ) ||
+ ((state()==IteratorState::valid) &&
+ (i.state()==IteratorState::past_the_end)));
};
TriaRawIterator<dim,Accessor> &
TriaRawIterator<dim,Accessor>::operator ++ ()
{
- Assert (state() == valid, ExcAdvanceInvalidObject());
+ Assert (state() == IteratorState::valid, ExcAdvanceInvalidObject());
++accessor;
return *this;
TriaRawIterator<dim,Accessor> &
TriaRawIterator<dim,Accessor>::operator -- ()
{
- Assert (state() == valid, ExcAdvanceInvalidObject());
+ Assert (state() == IteratorState::valid, ExcAdvanceInvalidObject());
--accessor;
return *this;
#ifdef DEBUG
// do this like this, because:
// if we write
- // "Assert (past_the_end || used)"
+ // "Assert (IteratorState::past_the_end || used)"
// used() is called anyway, even if
- // state==past_the_end, and will then
+ // state==IteratorState::past_the_end, and will then
// throw the exception!
- if (state() != past_the_end)
+ if (state() != IteratorState::past_the_end)
Assert (accessor.used(),
ExcAssignmentOfUnusedObject());
#endif
#ifdef DEBUG
// do this like this, because:
// if we write
- // "Assert (past_the_end || used)"
+ // "Assert (IteratorState::past_the_end || used)"
// has_children() is called anyway, even if
- // state==past_the_end, and will then
+ // state==IteratorState::past_the_end, and will then
// throw the exception!
- if (state() != past_the_end)
+ if (state() != IteratorState::past_the_end)
Assert (accessor.has_children()==false,
ExcAssignmentOfInactiveObject());
#endif
#ifdef DEBUG
// do this like this, because:
// if we write
- // "Assert (past_the_end || used)"
+ // "Assert (IteratorState::past_the_end || used)"
// used() is called anyway, even if
- // state==past_the_end, and will then
+ // state==IteratorState::past_the_end, and will then
// throw the exception!
- if (state() != past_the_end)
+ if (state() != IteratorState::past_the_end)
Assert (accessor.used(),
ExcAssignmentOfUnusedObject());
#endif
#ifdef DEBUG
// do this like this, because:
// if we write
- // "Assert (past_the_end || used)"
+ // "Assert (IteratorState::past_the_end || used)"
// used() is called anyway, even if
- // state==past_the_end, and will then
+ // state==IteratorState::past_the_end, and will then
// throw the exception!
- if (state() != past_the_end)
+ if (state() != IteratorState::past_the_end)
Assert (accessor.used(),
ExcAssignmentOfUnusedObject());
#endif
#ifdef DEBUG
// do this like this, because:
// if we write
- // "Assert (past_the_end || used)"
+ // "Assert (IteratorState::past_the_end || used)"
// used() is called anyway, even if
- // state==past_the_end, and will then
+ // state==IteratorState::past_the_end, and will then
// throw the exception!
- if (state() != past_the_end)
+ if (state() != IteratorState::past_the_end)
Assert (accessor.used(),
ExcAssignmentOfUnusedObject());
#endif
inline
TriaIterator<dim,Accessor> & TriaIterator<dim,Accessor>::operator ++ () {
while (TriaRawIterator<dim,Accessor>::operator++(),
- (state() == valid))
+ (state() == IteratorState::valid))
if (accessor.used() == true)
return *this;
return *this;
TriaIterator<dim,Accessor> &
TriaIterator<dim,Accessor>::operator -- () {
while (TriaRawIterator<dim,Accessor>::operator--(),
- (state() == valid))
+ (state() == IteratorState::valid))
if (accessor.used() == true)
return *this;
return *this;
#ifdef DEBUG
// do this like this, because:
// if we write
- // "Assert (past_the_end || used)"
+ // "Assert (IteratorState::past_the_end || used)"
// has_children() is called anyway, even if
- // state==past_the_end, and will then
+ // state==IteratorState::past_the_end, and will then
// throw the exception!
- if (state() != past_the_end)
+ if (state() != IteratorState::past_the_end)
Assert (accessor.has_children()==false,
ExcAssignmentOfInactiveObject());
#endif
#ifdef DEBUG
// do this like this, because:
// if we write
- // "Assert (past_the_end || used)"
+ // "Assert (IteratorState::past_the_end || used)"
// has_children() is called anyway, even if
- // state==past_the_end, and will then
+ // state==IteratorState::past_the_end, and will then
// throw the exception!
- if (state() != past_the_end)
+ if (state() != IteratorState::past_the_end)
Assert (accessor.has_children()==false,
ExcAssignmentOfInactiveObject());
#endif
#ifdef DEBUG
// do this like this, because:
// if we write
- // "Assert (past_the_end || used)"
+ // "Assert (IteratorState::past_the_end || used)"
// has_children() is called anyway, even if
- // state==past_the_end, and will then
+ // state==IteratorState::past_the_end, and will then
// throw the exception!
- if (state() != past_the_end)
+ if (state() != IteratorState::past_the_end)
Assert (accessor.has_children()==false,
ExcAssignmentOfInactiveObject());
#endif
#ifdef DEBUG
// do this like this, because:
// if we write
- // "Assert (past_the_end || used)"
+ // "Assert (IteratorState::past_the_end || used)"
// has_chidlren() is called anyway, even if
- // state==past_the_end, and will then
+ // state==IteratorState::past_the_end, and will then
// throw the exception!
- if (state() != past_the_end)
+ if (state() != IteratorState::past_the_end)
Assert (accessor.used() && accessor.has_children()==false,
ExcAssignmentOfInactiveObject());
#endif
#ifdef DEBUG
// do this like this, because:
// if we write
- // "Assert (past_the_end || used)"
+ // "Assert (IteratorState::past_the_end || used)"
// has_children() is called anyway, even if
- // state==past_the_end, and will then
+ // state==IteratorState::past_the_end, and will then
// throw the exception!
- if (state() != past_the_end)
+ if (state() != IteratorState::past_the_end)
Assert (accessor.has_children()==false,
ExcAssignmentOfInactiveObject());
#endif
TriaActiveIterator<dim,Accessor> &
TriaActiveIterator<dim,Accessor>::operator ++ () {
while (TriaIterator<dim,Accessor>::operator++(),
- (state() == valid))
+ (state() == IteratorState::valid))
if (accessor.has_children() == false)
return *this;
return *this;
TriaActiveIterator<dim,Accessor> &
TriaActiveIterator<dim,Accessor>::operator -- () {
while (TriaIterator<dim,Accessor>::operator--(),
- (state() == valid))
+ (state() == IteratorState::valid))
if (accessor.has_children() == false)
return *this;
return *this;
#include <base/config.h>
+
+/**
+ * Namespace in which an enumeration is declared that denotes the
+ * states in which an iterator can be in.
+ */
+namespace IteratorState
+{
+
/**
* The three states an iterator can be in: valid, past-the-end and
* invalid.
*/
-enum IteratorState
-{
- valid,
- past_the_end,
- invalid
+ enum IteratorState
+ {
+ valid,
+ past_the_end,
+ invalid
+ };
};
+
#endif
{
cell_iterator neighbor = cell->neighbor(v);
- if (neighbor.state() == valid)
+ if (neighbor.state() == IteratorState::valid)
{
// find true neighbor; may be its
// a child of @p{neighbor}
typename InterGridMap<GridClass,dim>::cell_iterator
InterGridMap<GridClass,dim>::operator [] (const cell_iterator &source_cell) const
{
- Assert (source_cell.state() == valid,
+ Assert (source_cell.state() == IteratorState::valid,
ExcInvalidKey (source_cell));
Assert (source_cell->level() <= static_cast<int>(mapping.size()),
ExcInvalidKey (source_cell));
{
// level is checked in begin_raw
raw_line_iterator ri = begin_raw_line (level);
- if (ri.state() != valid)
+ if (ri.state() != IteratorState::valid)
return ri;
while (ri->used() == false)
- if ((++ri).state() != valid)
+ if ((++ri).state() != IteratorState::valid)
return ri;
return ri;
};
{
// level is checked in begin_raw
raw_quad_iterator ri = begin_raw_quad (level);
- if (ri.state() != valid)
+ if (ri.state() != IteratorState::valid)
return ri;
while (ri->used() == false)
- if ((++ri).state() != valid)
+ if ((++ri).state() != IteratorState::valid)
return ri;
return ri;
};
{
// level is checked in begin_raw
raw_hex_iterator ri = begin_raw_hex (level);
- if (ri.state() != valid)
+ if (ri.state() != IteratorState::valid)
return ri;
while (ri->used() == false)
- if ((++ri).state() != valid)
+ if ((++ri).state() != IteratorState::valid)
return ri;
return ri;
};
{
// level is checked in begin_raw
line_iterator i = begin_line (level);
- if (i.state() != valid)
+ if (i.state() != IteratorState::valid)
return i;
while (i->has_children())
- if ((++i).state() != valid)
+ if ((++i).state() != IteratorState::valid)
return i;
return i;
};
{
// level is checked in begin_raw
quad_iterator i = begin_quad (level);
- if (i.state() != valid)
+ if (i.state() != IteratorState::valid)
return i;
while (i->has_children())
- if ((++i).state() != valid)
+ if ((++i).state() != IteratorState::valid)
return i;
return i;
};
{
// level is checked in begin_raw
hex_iterator i = begin_hex (level);
- if (i.state() != valid)
+ if (i.state() != IteratorState::valid)
return i;
while (i->has_children())
- if ((++i).state() != valid)
+ if ((++i).state() != IteratorState::valid)
return i;
return i;
};
raw_line_iterator ri = last_raw_line(level);
if (ri->used()==true)
return ri;
- while ((--ri).state() == valid)
+ while ((--ri).state() == IteratorState::valid)
if (ri->used()==true)
return ri;
return ri;
raw_quad_iterator ri = last_raw_quad(level);
if (ri->used()==true)
return ri;
- while ((--ri).state() == valid)
+ while ((--ri).state() == IteratorState::valid)
if (ri->used()==true)
return ri;
return ri;
raw_hex_iterator ri = last_raw_hex(level);
if (ri->used()==true)
return ri;
- while ((--ri).state() == valid)
+ while ((--ri).state() == IteratorState::valid)
if (ri->used()==true)
return ri;
return ri;
line_iterator i = last_line(level);
if (i->has_children()==false)
return i;
- while ((--i).state() == valid)
+ while ((--i).state() == IteratorState::valid)
if (i->has_children()==false)
return i;
return i;
quad_iterator i = last_quad(level);
if (i->has_children()==false)
return i;
- while ((--i).state() == valid)
+ while ((--i).state() == IteratorState::valid)
if (i->has_children()==false)
return i;
return i;
hex_iterator i = last_hex(level);
if (i->has_children()==false)
return i;
- while ((--i).state() == valid)
+ while ((--i).state() == IteratorState::valid)
if (i->has_children()==false)
return i;
return i;
// (refer to \Ref{TriangulationLevel<0>}
// for details)
first_child->set_neighbor (1, second_child);
- if (cell->neighbor(0).state() != valid)
+ if (cell->neighbor(0).state() != IteratorState::valid)
first_child->set_neighbor (0, cell->neighbor(0));
else
if (cell->neighbor(0)->active())
second_child->set_neighbor (0, first_child);
second_child->set_material_id (cell->material_id());
second_child->set_subdomain_id (cell->subdomain_id());
- if (cell->neighbor(1).state() != valid)
+ if (cell->neighbor(1).state() != IteratorState::valid)
second_child->set_neighbor (1, cell->neighbor(1));
else
if (cell->neighbor(1)->active())
{
const cell_iterator neighbor = acell->neighbor(nb);
// if cell is at boundary
- if (neighbor.state() != valid)
+ if (neighbor.state() != IteratorState::valid)
{
// new midpoint vertex
// necessary
#ifdef DEBUG
for (unsigned int neighbor=0;
neighbor<GeometryInfo<dim>::faces_per_cell; ++neighbor)
- if (cell->neighbor(neighbor).state() == valid)
+ if (cell->neighbor(neighbor).state() == IteratorState::valid)
Assert (((cell->neighbor(neighbor)->level() == cell->level()) &&
(cell->neighbor(neighbor)->coarsen_flag_set() == false)) ||
((cell->neighbor(neighbor)->level() == cell->level()-1) &&
for (unsigned int nb=0; nb<4; ++nb)
{
bool neighbor_refined=false;
- if (cell->neighbor(nb).state() == valid)
+ if (cell->neighbor(nb).state() == IteratorState::valid)
if (cell->neighbor(nb)->active() == false)
// (ask in two if-statements,
// since otherwise both
const int neighbor_mapping[8] = {0,1, 1,2, 2,3, 3,0};
for (unsigned int nb=0; nb<8; ++nb)
- if (neighbors[nb].state() == valid)
+ if (neighbors[nb].state() == IteratorState::valid)
if (neighbors[nb]->level() == level+1)
// neighbor is refined cell
neighbors[nb]->set_neighbor(neighbors_neighbor[nb],
#ifdef DEBUG
for (unsigned int neighbor=0;
neighbor<GeometryInfo<dim>::faces_per_cell; ++neighbor)
- if (hex->neighbor(neighbor).state() == valid)
+ if (hex->neighbor(neighbor).state() == IteratorState::valid)
Assert (((hex->neighbor(neighbor)->level() == hex->level()) &&
(hex->neighbor(neighbor)->coarsen_flag_set() == false)) ||
((hex->neighbor(neighbor)->level() == hex->level()-1) &&
const cell_iterator neighbor = hex->neighbor(face);
// if no neighbor
- if (neighbor.state() != valid)
+ if (neighbor.state() != IteratorState::valid)
for (unsigned int child_face=0;
child_face<GeometryInfo<dim>::subfaces_per_face;
++child_face)
neighbor_cells[face][c]
= neighbor->child(GeometryInfo<dim>::child_cell_on_face(nb_nb, c));
- Assert (neighbor_cells[face][c].state() == valid,
+ Assert (neighbor_cells[face][c].state() ==
+ IteratorState::valid,
ExcInternalError());
Assert (!neighbor_cells[face][c]->has_children(),
ExcInternalError());
for (unsigned int nb=0; nb<GeometryInfo<dim>::faces_per_cell; ++nb)
for (unsigned int subface=0;
subface<GeometryInfo<dim>::subfaces_per_face; ++subface)
- if ((neighbor_cells[nb][subface].state() == valid) &&
+ if ((neighbor_cells[nb][subface].state() ==
+ IteratorState::valid) &&
(neighbor_cells[nb][subface]->level() ==
hex->level()+1))
{
for (unsigned int n=0; n<GeometryInfo<dim>::faces_per_cell; ++n)
{
const cell_iterator child_neighbor = cell->child(c)->neighbor(n);
- if (child_neighbor.state() == valid)
+ if (child_neighbor.state() == IteratorState::valid)
if (child_neighbor->has_children() ||
// neighbor has children,
// then only allow coarsening
n<GeometryInfo<dim>::faces_per_cell; ++n)
{
const cell_iterator neighbor = cell->neighbor(n);
- if (neighbor.state() == valid)
+ if (neighbor.state() == IteratorState::valid)
{
++n_neighbors;
for (unsigned int n=0; n<GeometryInfo<dim>::faces_per_cell; ++n)
{
const cell_iterator neighbor = cell->neighbor(n);
- if (neighbor.state() == valid)
+ if (neighbor.state() == IteratorState::valid)
++total_neighbors;
- if (neighbor.state() == valid)
+ if (neighbor.state() == IteratorState::valid)
if ((neighbor->active() &&
!neighbor->refine_flag_set()) ||
(neighbor->level() == cell->level()-1))
{
// loop over neighbors of cell
for (unsigned int i=0; i<GeometryInfo<dim>::faces_per_cell; ++i)
- if (cell->neighbor(i).state() == valid)
+ if (cell->neighbor(i).state() == IteratorState::valid)
{
// regularisation?
if ((cell->neighbor_level(i) == cell->level()-1)
// first do it for the cells to the
// left
- if (cell->neighbor(0).state() == valid)
+ if (cell->neighbor(0).state() == IteratorState::valid)
if (cell->neighbor(0)->has_children())
{
cell_iterator neighbor = cell->neighbor(0);
// now do it for the cells to the
// left
- if (cell->neighbor(1).state() == valid)
+ if (cell->neighbor(1).state() == IteratorState::valid)
if (cell->neighbor(1)->has_children())
{
cell_iterator neighbor = cell->neighbor(1);
{
const cell_iterator neighbor = cell->child(child)->neighbor(n);
// do nothing if at boundary
- if (neighbor.state() != valid)
+ if (neighbor.state() != IteratorState::valid)
continue;
Assert ((neighbor->level()==cell->level()) ||
// one less or the same as that of
// cell
for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
- if ((cell->neighbor(face).state() != valid) ||
+ if ((cell->neighbor(face).state() != IteratorState::valid) ||
(cell->neighbor(face)->level() == cell->level()-1) ||
((cell->neighbor(face)->level() == cell->level()) &&
!cell->neighbor(face)->has_children()))
{
const cell_iterator neighbor = cell->child(child)->neighbor(n);
// do nothing if at boundary
- if (neighbor.state() != valid)
+ if (neighbor.state() != IteratorState::valid)
continue;
Assert ((neighbor->level()==cell->level()) ||
// one less or the same as that of
// cell
for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
- if ((cell->neighbor(face).state() != valid) ||
+ if ((cell->neighbor(face).state() != IteratorState::valid) ||
(cell->neighbor(face)->level() == cell->level()-1) ||
((cell->neighbor(face)->level() == cell->level()) &&
!cell->neighbor(face)->has_children()))
{
const cell_iterator neighbor = cell->neighbor(nb);
// do nothing if at boundary
- if (neighbor.state() != valid)
+ if (neighbor.state() != IteratorState::valid)
continue;
Assert (neighbor->level() == cell->level(),
{
const cell_iterator neighbor_neighbor = neighbor->neighbor(nb_nb);
// do nothing if at boundary
- if (neighbor_neighbor.state() != valid)
+ if (neighbor_neighbor.state() != IteratorState::valid)
continue;
Assert ((neighbor_neighbor->level() == cell->level()) ||
template <int dim>
void TriaObjectAccessor<1, dim>::set_used_flag () const
{
- Assert (state() == valid,
+ Assert (state() == IteratorState::valid,
typename TriaAccessor<dim>::ExcDereferenceInvalidObject());
tria->levels[present_level]->lines.used[present_index] = true;
};
template <int dim>
void TriaObjectAccessor<1, dim>::clear_used_flag () const
{
- Assert (state() == valid,
+ Assert (state() == IteratorState::valid,
typename TriaAccessor<dim>::ExcDereferenceInvalidObject());
tria->levels[present_level]->lines.used[present_index] = false;
};
void
TriaObjectAccessor<2, dim>::set_used_flag () const
{
- Assert (state() == valid, typename TriaAccessor<dim>::ExcDereferenceInvalidObject());
+ Assert (state() == IteratorState::valid,
+ typename TriaAccessor<dim>::ExcDereferenceInvalidObject());
tria->levels[present_level]->quads.used[present_index] = true;
};
template <int dim>
void TriaObjectAccessor<2, dim>::clear_used_flag () const
{
- Assert (state() == valid, typename TriaAccessor<dim>::ExcDereferenceInvalidObject());
+ Assert (state() == IteratorState::valid,
+ typename TriaAccessor<dim>::ExcDereferenceInvalidObject());
tria->levels[present_level]->quads.used[present_index] = false;
};
template <int dim>
void TriaObjectAccessor<3, dim>::set_used_flag () const
{
- Assert (state() == valid, typename TriaAccessor<dim>::ExcDereferenceInvalidObject());
+ Assert (state() == IteratorState::valid,
+ typename TriaAccessor<dim>::ExcDereferenceInvalidObject());
tria->levels[present_level]->hexes.used[present_index] = true;
};
template <int dim>
void TriaObjectAccessor<3, dim>::clear_used_flag () const
{
- Assert (state() == valid, typename TriaAccessor<dim>::ExcDereferenceInvalidObject());
+ Assert (state() == IteratorState::valid,
+ typename TriaAccessor<dim>::ExcDereferenceInvalidObject());
tria->levels[present_level]->hexes.used[present_index] = false;
};
Assert (i<GeometryInfo<dim>::faces_per_cell,
typename TriaAccessor<dim>::ExcInvalidNeighbor(i));
- if (pointer.state() == valid)
+ if (pointer.state() == IteratorState::valid)
{
tria->levels[present_level]->
neighbors[present_index*GeometryInfo<dim>::faces_per_cell+i].first
mg_dof_handler);
#ifdef DEBUG
- if (q.state() != past_the_end)
+ if (q.state() != IteratorState::past_the_end)
Assert (q->used(), typename TriaAccessor<dim>::ExcUnusedCellAsChild());
#endif
return q;
mg_dof_handler);
#ifdef DEBUG
- if (q.state() != past_the_end)
+ if (q.state() != IteratorState::past_the_end)
Assert (q->used(), typename TriaAccessor<dim>::ExcUnusedCellAsChild());
#endif
return q;
mg_dof_handler);
#ifdef DEBUG
- if (q.state() != past_the_end)
+ if (q.state() != IteratorState::past_the_end)
Assert (q->used(), typename TriaAccessor<dim>::ExcUnusedCellAsChild());
#endif
return q;
mg_dof_handler);
#ifdef DEBUG
- if (q.state() != past_the_end)
+ if (q.state() != IteratorState::past_the_end)
Assert (q->used(), typename TriaAccessor<dim>::ExcUnusedCellAsNeighbor());
#endif
return q;
mg_dof_handler);
#ifdef DEBUG
- if (q.state() != past_the_end)
+ if (q.state() != IteratorState::past_the_end)
Assert (q->used(), typename TriaAccessor<dim>::ExcUnusedCellAsChild());
#endif
return q;
{
cell_iterator neighbor = cell->neighbor(v);
- if (neighbor.state() == valid)
+ if (neighbor.state() == IteratorState::valid)
{
// has neighbor already been processed?
if (neighbor->user_flag_set() &&
for (typename MGDoFHandler<dim>::cell_iterator cell=mg_dof.begin(level);
cell != mg_dof.end(level); ++cell)
for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
- if ((cell->neighbor(face).state() == valid) &&
+ if ((cell->neighbor(face).state() == IteratorState::valid) &&
(static_cast<unsigned int>(cell->neighbor(face)->level())
== level-1))
{
{
// find right active neighbor
DoFHandler<dim>::cell_iterator neighbor = cell->neighbor(n);
- if (neighbor.state() == valid)
+ if (neighbor.state() == IteratorState::valid)
while (neighbor->has_children())
neighbor = neighbor->child(n==0 ? 1 : 0);
for (unsigned int s=0; s<n_solution_vectors; ++s)
fe_values.get_function_grads (*solutions[s], gradients_here[s]);
- if (neighbor.state() == valid)
+ if (neighbor.state() == IteratorState::valid)
{
fe_values.reinit (neighbor);
// internal face; integrate jump
// of gradient across this face
{
- Assert (cell->neighbor(face_no).state() == valid,
+ Assert (cell->neighbor(face_no).state() == IteratorState::valid,
ExcInternalError());
const active_cell_iterator neighbor = cell->neighbor(face_no);
n_components = data.dof_handler.get_fe().n_components(),
n_solution_vectors = data.n_solution_vectors;
- Assert (neighbor.state() == valid, ExcInternalError());
+ Assert (neighbor.state() == IteratorState::valid, ExcInternalError());
Assert (neighbor->has_children(), ExcInternalError());
// set up a vector of the gradients
// of the finite element function
// grid to its end and then going
// to the children
DoFHandler<1>::cell_iterator outermost_cell = dof.begin(0);
- while (outermost_cell->neighbor(direction).state() == valid)
+ while (outermost_cell->neighbor(direction).state() == IteratorState::valid)
outermost_cell = outermost_cell->neighbor(direction);
while (outermost_cell->has_children())
<h3>deal.II</h3>
<ol>
+ <li> <p>
+ Changed: The <code class="class">IteratorState</code> enum used
+ to indicate the state in which an iterator can be is now
+ enclosed in a namespace of the same name, to take its members
+ out of the global namespace. When using one of these members,
+ you now have to prefix it by <code
+ class="class">IteratorState::</code>.
+ <br>
+ (RH, WB 2001/11/30)
+ </p>
+
<li> <p>
Changed: The <code class="class">NormType</code> enum used to
indicate the norm the <code
}
else
{
- Assert (cell->neighbor(face_no).state() == valid, ExcInternalError());
+ Assert (cell->neighbor(face_no).state() == IteratorState::valid,
+ ExcInternalError());
typename DoFHandler<dim>::cell_iterator neighbor=
cell->neighbor(face_no);
// Case 2: