MGDoFAccessor< structdim, dim, spacedim > Class Template Reference
[Multilevel supportDegrees of FreedomAccessor classes of the mesh iterators]

Inheritance diagram for MGDoFAccessor< structdim, dim, spacedim >:

Inheritance graph
[legend]

List of all members.

Classes

class  ExcInvalidObject

Public Types

typedef
internal::MGDoFAccessor::Inheritance
< structdim, dim, spacedim >
::BaseClass 
BaseClass
typedef MGDoFHandler< dim,
spacedim > 
AccessorData

Public Member Functions

void copy_from (const MGDoFAccessor &a)
Constructors
 MGDoFAccessor ()
 MGDoFAccessor (const Triangulation< dim, spacedim > *tria, const int level, const int index, const AccessorData *local_data)
template<int structdim2, int dim2, int spacedim2>
 MGDoFAccessor (const InvalidAccessor< structdim2, dim2, spacedim2 > &)
template<int structdim2, int dim2, int spacedim2>
 MGDoFAccessor (const MGDoFAccessor< structdim2, dim2, spacedim2 > &)
Accessing the DoF indices of this object
void get_mg_dof_indices (const int level, std::vector< unsigned int > &dof_indices) const
template<typename number >
void get_mg_dof_values (const int level, const Vector< number > &values, Vector< number > &dof_values) const
unsigned int mg_vertex_dof_index (const int level, const unsigned int vertex, const unsigned int i) const
unsigned int mg_dof_index (const int level, const unsigned int i) const
Accessing sub-objects
TriaIterator< MGDoFAccessor
< structdim, dim, spacedim > > 
child (const unsigned int) const
internal::MGDoFHandler::Iterators
< dim, spacedim >
::line_iterator 
line (const unsigned int i) const
internal::MGDoFHandler::Iterators
< dim, spacedim >
::quad_iterator 
quad (const unsigned int i) const

Protected Member Functions

void set_mg_dof_handler (MGDoFHandler< dim, spacedim > *dh)
void set_mg_vertex_dof_index (const int level, const unsigned int vertex, const unsigned int i, const unsigned int index) const
void set_mg_dof_index (const int level, const unsigned int i, const unsigned int index) const
MGDoFAccessoroperator= (const MGDoFAccessor &da)

Protected Attributes

MGDoFHandler< dim, spacedim > * mg_dof_handler

Friends

class MGDoFHandler


Detailed Description

template<int structdim, int dim, int spacedim>
class MGDoFAccessor< structdim, dim, spacedim >

A class that gives access to the degrees of freedom stored in a MGDoFHandler. Accessors are used to, well, access the data that pertains to edges, faces, and cells of a triangulation. The concept is explained in more detail in connection to Iterators on mesh-like containers.

This class follows mainly the route laid out by the accessor library declared in the triangulation library (TriaAccessor). It enables the user to access the degrees of freedom on lines, quads, or hexes, as well as the multigrid degrees of freedom associated with these objects. The first template argument of this class determines the dimensionality of the object under consideration: 1 for lines, 2 for quads, and 3 for hexes. The second template argument determines the dimensionality of the triangulation to which this object belongs, and the third the dimensionality of the space in which it is embedded.

Depending on whether the structural dimension of the object accessed equals the dimension on which the DoF handler object operates, this class is derived from CellAccessor or TriaAccessor. This means that, for example accessors to quads in 2d have access to all the mesh aspects of cells, whereas accessors to quads in 3d can only access things that make sense for faces.

Usage

Usage is best to happen through the typedefs to the various kinds of iterators provided by the MGDoFHandler class, since they are more secure to changes in the class naming and template interface as well as providing easier typing (much less complicated names!).

Inheritance

If the structural dimension given by the first template argument equals the dimension of the MGDoFHandler (given as the second template argument), then we are obviously dealing with cells, rather than lower-dimensional objects. In that case, inheritance is from DoFCellAccessor, to provide access to all the cell specific information afforded by that class. Otherwise, i.e. for lower-dimensional objects, inheritance is from DoFAccessor.

There is a MGDoFCellAccessor class that provides the equivalent to the CellAccessor and DoFCellAccessor classes.

Author:
Wolfgang Bangerth, 1998, 2006, 2008

Member Typedef Documentation

template<int structdim, int dim, int spacedim>
typedef internal::MGDoFAccessor::Inheritance<structdim,dim,spacedim>::BaseClass MGDoFAccessor< structdim, dim, spacedim >::BaseClass

Declare a typedef to the base class to make accessing some of the exception classes simpler.

Reimplemented from DoFAccessor< dim, spacedim > >.

Reimplemented in MGDoFCellAccessor< dim, spacedim >.

template<int structdim, int dim, int spacedim>
typedef MGDoFHandler<dim,spacedim> MGDoFAccessor< structdim, dim, spacedim >::AccessorData

A typedef necessary for the iterator classes.

Reimplemented from DoFAccessor< dim, spacedim > >.

Reimplemented in MGDoFCellAccessor< dim, spacedim >.


Constructor & Destructor Documentation

template<int structdim, int dim, int spacedim>
MGDoFAccessor< structdim, dim, spacedim >::MGDoFAccessor (  ) 

Default constructor. Creates an object that is not usable.

template<int structdim, int dim, int spacedim>
MGDoFAccessor< structdim, dim, spacedim >::MGDoFAccessor ( const Triangulation< dim, spacedim > *  tria,
const int  level,
const int  index,
const AccessorData local_data 
)

Constructor.

template<int structdim, int dim, int spacedim>
template<int structdim2, int dim2, int spacedim2>
MGDoFAccessor< structdim, dim, spacedim >::MGDoFAccessor ( const InvalidAccessor< structdim2, dim2, spacedim2 > &   )  [inline]

Conversion constructor. This constructor exists to make certain constructs simpler to write in dimension independent code. For example, it allows assigning a face iterator to a line iterator, an operation that is useful in 2d but doesn't make any sense in 3d. The constructor here exists for the purpose of making the code conform to C++ but it will unconditionally abort; in other words, assigning a face iterator to a line iterator is better put into an if-statement that checks that the dimension is two, and assign to a quad iterator in 3d (an operator that, without this constructor would be illegal if we happen to compile for 2d).

template<int structdim, int dim, int spacedim>
template<int structdim2, int dim2, int spacedim2>
MGDoFAccessor< structdim, dim, spacedim >::MGDoFAccessor ( const MGDoFAccessor< structdim2, dim2, spacedim2 > &   )  [inline]

Another conversion operator between objects that don't make sense, just like the previous one.


Member Function Documentation

template<int structdim, int dim, int spacedim>
void MGDoFAccessor< structdim, dim, spacedim >::get_mg_dof_indices ( const int  level,
std::vector< unsigned int > &  dof_indices 
) const

Return the indices of the dofs of this object in the standard ordering: dofs on vertex 0, dofs on vertex 1, ... dofs on line 0, dofs on line 1, ..., then quads, then hexes.

It is assumed that the vector already has the right size beforehand. The indices refer to the local numbering for the level this line lives on.

template<int structdim, int dim, int spacedim>
template<typename number >
void MGDoFAccessor< structdim, dim, spacedim >::get_mg_dof_values ( const int  level,
const Vector< number > &  values,
Vector< number > &  dof_values 
) const [inline]

Return the value of the given vector restricted to the dofs of this cell in the standard ordering: dofs on vertex 0, dofs on vertex 1, etc, dofs on line 0, dofs on line 1, etc, dofs on quad 0, etc.

It is assumed that the vector already has the right size beforehand. The indices refer to the multilevel numbering local to the present level of this cell. The vector shall therefore have the same number of entries as there are degrees of freedom on this level.

template<int structdim, int dim, int spacedim>
unsigned int MGDoFAccessor< structdim, dim, spacedim >::mg_vertex_dof_index ( const int  level,
const unsigned int  vertex,
const unsigned int  i 
) const

Return the index of the ith degree on the vertexth vertex for the level this object lives on.

template<int structdim, int dim, int spacedim>
unsigned int MGDoFAccessor< structdim, dim, spacedim >::mg_dof_index ( const int  level,
const unsigned int  i 
) const

Return the index of the ith degree of freedom of this line on the level this line lives on.

template<int structdim, int dim, int spacedim>
TriaIterator<MGDoFAccessor<structdim,dim,spacedim> > MGDoFAccessor< structdim, dim, spacedim >::child ( const unsigned  int  )  const

Return an iterator to the i-th child.

Reimplemented from DoFAccessor< dim, spacedim > >.

Reimplemented in MGDoFCellAccessor< dim, spacedim >.

template<int structdim, int dim, int spacedim>
internal::MGDoFHandler::Iterators<dim,spacedim>::line_iterator MGDoFAccessor< structdim, dim, spacedim >::line ( const unsigned int  i  )  const

Return a pointer to the ith line bounding this Hex.

Reimplemented from DoFAccessor< dim, spacedim > >.

template<int structdim, int dim, int spacedim>
internal::MGDoFHandler::Iterators<dim,spacedim>::quad_iterator MGDoFAccessor< structdim, dim, spacedim >::quad ( const unsigned int  i  )  const

Return a pointer to the ith quad bounding this Hex.

Reimplemented from DoFAccessor< dim, spacedim > >.

template<int structdim, int dim, int spacedim>
void MGDoFAccessor< structdim, dim, spacedim >::copy_from ( const MGDoFAccessor< structdim, dim, spacedim > &  a  ) 

Implement the copy operator needed for the iterator classes.

template<int structdim, int dim, int spacedim>
void MGDoFAccessor< structdim, dim, spacedim >::set_mg_dof_handler ( MGDoFHandler< dim, spacedim > *  dh  )  [protected]

Reset the DoF handler pointer.

template<int structdim, int dim, int spacedim>
void MGDoFAccessor< structdim, dim, spacedim >::set_mg_vertex_dof_index ( const int  level,
const unsigned int  vertex,
const unsigned int  i,
const unsigned int  index 
) const [protected]

Set the index of the ith degree on the vertexth vertex to index for the level this object lives on.

template<int structdim, int dim, int spacedim>
void MGDoFAccessor< structdim, dim, spacedim >::set_mg_dof_index ( const int  level,
const unsigned int  i,
const unsigned int  index 
) const [protected]

Set the index of the ith degree of freedom of this line on the level this line lives on to index.

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

Copy operator.


Friends And Related Function Documentation

template<int structdim, int dim, int spacedim>
friend class MGDoFHandler [friend]


Member Data Documentation

template<int structdim, int dim, int spacedim>
MGDoFHandler<dim,spacedim>* MGDoFAccessor< structdim, dim, spacedim >::mg_dof_handler [protected]

Store the address of the MGDoFHandler object to be accessed.


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

deal.II documentation generated on Sat Aug 15 16:52:08 2009 by doxygen 1.5.9