RefinementCase< dim > Class Template Reference

Inheritance diagram for RefinementCase< dim >:

Inheritance graph
[legend]

List of all members.

Classes

class  ExcInvalidRefinementCase

Public Member Functions

 RefinementCase (const typename RefinementPossibilities< dim >::Possibilities refinement_case)
 RefinementCase (const unsigned char refinement_case)
 operator unsigned char () const
RefinementCase operator| (const RefinementCase &r) const
RefinementCase operator& (const RefinementCase &r) const
RefinementCase operator~ () const

Static Public Member Functions

static RefinementCase cut_axis (const unsigned int i)
static unsigned int memory_consumption ()

Private Attributes

unsigned char value: (dim > 0 ? dim : 1)


Detailed Description

template<int dim>
class RefinementCase< dim >

A class storing the possible anisotropic and isotropic refinement cases of an object with dim dimensions (for example, for a line dim=1 in whatever space dimension we are, for a quad dim=2, etc.). Possible values of this class are the ones listed in the enumeration declared within the class.

Author:
Ralf Hartmann, 2005, Wolfgang Bangerth, 2007

Constructor & Destructor Documentation

template<int dim>
RefinementCase< dim >::RefinementCase ( const typename RefinementPossibilities< dim >::Possibilities  refinement_case  ) 

Constructor. Take and store a value indicating a particular refinement from the list of possible refinements specified in the base class.

template<int dim>
RefinementCase< dim >::RefinementCase ( const unsigned char  refinement_case  )  [explicit]

Constructor. Take and store a value indicating a particular refinement as a bit field. To avoid implicit conversions to and from integral values, this constructor is marked as explicit.


Member Function Documentation

template<int dim>
RefinementCase< dim >::operator unsigned char (  )  const

Return the numeric value stored by this class. While the presence of this operator might seem dangerous, it is useful in cases where one would like to have code like switch (refinement_flag)... case RefinementCase<dim>::cut_x: ... , which can be written as switch (static_cast<unsigned char>(refinement_flag). Another application is to use an object of the current type as an index into an array; however, this use is deprecated as it assumes a certain mapping from the symbolic flags defined in the RefinementPossibilities base class to actual numerical values (the array indices).

template<int dim>
RefinementCase RefinementCase< dim >::operator| ( const RefinementCase< dim > &  r  )  const

Return the union of the refinement flags represented by the current object and the one given as argument.

template<int dim>
RefinementCase RefinementCase< dim >::operator& ( const RefinementCase< dim > &  r  )  const

Return the intersection of the refinement flags represented by the current object and the one given as argument.

template<int dim>
RefinementCase RefinementCase< dim >::operator~ (  )  const

Return the negation of the refinement flags represented by the current object. For example, in 2d, if the current object holds the flag cut_x, then the returned value will be cut_y; if the current value is isotropic_refinement then the result will be no_refinement; etc.

template<int dim>
static RefinementCase RefinementCase< dim >::cut_axis ( const unsigned int  i  )  [static]

Return the flag that corresponds to cutting a cell along the axis given as argument. For example, if i=0 then the returned value is RefinementPossibilities<dim>::cut_x.

template<int dim>
static unsigned int RefinementCase< dim >::memory_consumption (  )  [static]

Return the amount of memory occupied by an object of this type.


Member Data Documentation

template<int dim>
unsigned char RefinementCase< dim >::value [private]

Store the refinement case as a bit field with as many bits as are necessary in any given dimension.


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

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