TriaAccessorBase< dim, dim, spacedim > Class Template Reference
[Grid classesAccessor classes of the mesh iterators]

List of all members.

Public Member Functions

Iterator address and state



int level () const
int index () const
IteratorState::IteratorStates state () const
const Triangulation< dim,
spacedim > & 
get_triangulation () const

Protected Types

typedef void AccessorData

Protected Member Functions

 TriaAccessorBase (const Triangulation< dim, spacedim > *parent=0, const int level=-1, const int index=-1, const AccessorData *=0)
void copy_from (const TriaAccessorBase &)
void operator= (const TriaAccessorBase *)
TriaAccessorBaseoperator= (const TriaAccessorBase &)

Protected Attributes

int present_level
int present_index
const Triangulation< dim,
spacedim > * 
tria

Static Protected Attributes

static const unsigned int space_dimension = spacedim
static const unsigned int dimension = dim
static const unsigned int structure_dimension = dim

Friends

class TriaRawIterator
class TriaIterator
class TriaActiveIterator
class TriaAccessor

Advancement of iterators



typedef void * LocalData
void operator++ ()
void operator-- ()
internal::Triangulation::TriaObjects
< internal::Triangulation::TriaObject
< dim > > & 
objects () const
bool operator== (const TriaAccessorBase &) const
bool operator!= (const TriaAccessorBase &) const

Detailed Description

template<int dim, int spacedim>
class TriaAccessorBase< dim, dim, spacedim >

A base class for the accessor classes used by TriaRawIterator and derived classes.

This class offers only the basic functionality required by the iterators (stores the necessary data members, offers comparison operators and the like), but has no functionality to actually dereference data. This is done in the derived classes.

This template is a partial specialization of the general template used for cells only, i.e. for the case where structdim (the dimensionality of the object represented, for example 1 for a line) equals dim (the dimensionality of the triangulation the object lives in, for example 2 if we solve problems on a two-dimensional manifold -- whether this manifold is itself the space $R^2$ or embedded in a higher-dimensional space whose dimensionality is determined by the spacedim template argument). The reason for using a partial specialization rather than the general template is that cells have a level in the triangulation hierarchy associated with them, whereas faces and edges do not.

Some internals of this class are discussed in Iterator and accessor internals .

Author:
Wolfgang Bangerth, 1998

Member Typedef Documentation

template<int dim, int spacedim>
typedef void TriaAccessorBase< dim, dim, spacedim >::AccessorData [protected]

Declare the data type that this accessor class expects to get passed from the iterator classes. Since the pure triangulation iterators need no additional data, this data type is void.

template<int dim, int spacedim>
typedef void* TriaAccessorBase< dim, dim, spacedim >::LocalData

Data type to be used for passing parameters from iterators to the accessor classes in a unified way, no matter what the type of number of these parameters is.


Constructor & Destructor Documentation

template<int dim, int spacedim>
TriaAccessorBase< dim, dim, spacedim >::TriaAccessorBase ( const Triangulation< dim, spacedim > *  parent = 0,
const int  level = -1,
const int  index = -1,
const AccessorData = 0 
) [protected]

Constructor. Protected, thus only callable from friend classes.


Member Function Documentation

template<int dim, int spacedim>
void TriaAccessorBase< dim, dim, spacedim >::copy_from ( const TriaAccessorBase< dim, dim, spacedim > &   )  [protected]

Copy operator. Since this is only called from iterators, do not return anything, since the iterator will return itself.

This method is protected, since it is only to be called from the iterator class.

template<int dim, int spacedim>
void TriaAccessorBase< dim, dim, spacedim >::operator= ( const TriaAccessorBase< dim, dim, spacedim > *   )  [protected]

Copy operator. This is normally used in a context like iterator a,b; *a=*b;. Since the meaning is to copy the object pointed to by b to the object pointed to by a and since accessors are not real but virtual objects, this operation is not useful for iterators on triangulations. We declare this function here private, thus it may not be used from outside. Furthermore it is not implemented and will give a linker error if used anyway.

template<int dim, int spacedim>
TriaAccessorBase& TriaAccessorBase< dim, dim, spacedim >::operator= ( const TriaAccessorBase< dim, dim, spacedim > &   )  [protected]

Same as above.

template<int dim, int spacedim>
void TriaAccessorBase< dim, dim, spacedim >::operator++ (  )  [protected]

This operator advances the iterator to the next element.

For cells only: The next element is next on this level if there are more. If the present element is the last on this level, the first on the next level is accessed.

template<int dim, int spacedim>
void TriaAccessorBase< dim, dim, spacedim >::operator-- (  )  [protected]

This operator moves the iterator to the previous element.

For cells only: The previous element is previous on this level if index>0. If the present element is the first on this level, the last on the previous level is accessed.

template<int dim, int spacedim>
internal::Triangulation::TriaObjects<internal::Triangulation::TriaObject<dim> >& TriaAccessorBase< dim, dim, spacedim >::objects (  )  const [protected]

Access to the other objects of a Triangulation with same dimension.

template<int dim, int spacedim>
bool TriaAccessorBase< dim, dim, spacedim >::operator== ( const TriaAccessorBase< dim, dim, spacedim > &   )  const [protected]

Compare for equality.

template<int dim, int spacedim>
bool TriaAccessorBase< dim, dim, spacedim >::operator!= ( const TriaAccessorBase< dim, dim, spacedim > &   )  const [protected]

Compare for inequality.

template<int dim, int spacedim>
int TriaAccessorBase< dim, dim, spacedim >::level (  )  const

Return the level the element pointed to belongs to. This is only valid for cells.

template<int dim, int spacedim>
int TriaAccessorBase< dim, dim, spacedim >::index (  )  const

Return the index of the element presently pointed to on the present level.

template<int dim, int spacedim>
IteratorState::IteratorStates TriaAccessorBase< dim, dim, spacedim >::state (  )  const

Return the state of the iterator. For the different states an accessor can be in, refer to the TriaRawIterator documentation.

template<int dim, int spacedim>
const Triangulation<dim,spacedim>& TriaAccessorBase< dim, dim, spacedim >::get_triangulation (  )  const

Return a pointer to the triangulation which the object pointed to by this class belongs to.


Friends And Related Function Documentation

template<int dim, int spacedim>
friend class TriaRawIterator [friend]
template<int dim, int spacedim>
friend class TriaIterator [friend]
template<int dim, int spacedim>
friend class TriaActiveIterator [friend]
template<int dim, int spacedim>
friend class TriaAccessor [friend]

Member Data Documentation

template<int dim, int spacedim>
int TriaAccessorBase< dim, dim, spacedim >::present_level [protected]

Used to store the level presently pointed to. For faces this should always be 0.

template<int dim, int spacedim>
int TriaAccessorBase< dim, dim, spacedim >::present_index [protected]

Used to store the index of the element presently pointed to on the level presentl used.

template<int dim, int spacedim>
const Triangulation<dim,spacedim>* TriaAccessorBase< dim, dim, spacedim >::tria [protected]

Pointer to the triangulation which we act on.

template<int dim, int spacedim>
const unsigned int TriaAccessorBase< dim, dim, spacedim >::space_dimension = spacedim [static, protected]

Space dimension of the Accessor

template<int dim, int spacedim>
const unsigned int TriaAccessorBase< dim, dim, spacedim >::dimension = dim [static, protected]
template<int dim, int spacedim>
const unsigned int TriaAccessorBase< dim, dim, spacedim >::structure_dimension = dim [static, protected]

The documentation for this class was generated from the following file:

deal.II documentation generated on Mon Nov 23 22:58:15 2009 by doxygen 1.6.1