Classes | |
class | ExcInvalidLevel |
class | ExcNoMemory |
Public Member Functions | |
MGVertexDoFs () | |
void | init (const unsigned int coarsest_level, const unsigned int finest_level, const unsigned int dofs_per_vertex) |
~MGVertexDoFs () | |
MGVertexDoFs & | operator= (const MGVertexDoFs &vertex) |
void | set_index (const unsigned int level, const unsigned int dof_number, const unsigned int dofs_per_vertex, const unsigned int index) |
unsigned int | get_index (const unsigned int level, const unsigned int dof_number, const unsigned int dofs_per_vertex) const |
unsigned int | get_coarsest_level () const |
unsigned int | get_finest_level () const |
Private Attributes | |
unsigned int | coarsest_level |
unsigned int | finest_level |
unsigned int * | indices |
MGDoFHandler< dim, spacedim >::MGVertexDoFs::MGVertexDoFs | ( | ) |
Constructor. This one is empty because it is difficult to make it efficient to use vector<>'s and still construct the object using the constructor. Use the init
function to really allocate memory.
MGDoFHandler< dim, spacedim >::MGVertexDoFs::~MGVertexDoFs | ( | ) |
Destructor
void MGDoFHandler< dim, spacedim >::MGVertexDoFs::init | ( | const unsigned int | coarsest_level, | |
const unsigned int | finest_level, | |||
const unsigned int | dofs_per_vertex | |||
) |
Allocate memory and set all indices to -1
.
If coarsest_level
is greater than finest_level
, then no memory is allocated and the object is left in an invalid state. This is used for unused vertices.
MGVertexDoFs& MGDoFHandler< dim, spacedim >::MGVertexDoFs::operator= | ( | const MGVertexDoFs & | vertex | ) |
Assignment operator. Will throw an exception since it can't do the work that init
is supposed to do.
void MGDoFHandler< dim, spacedim >::MGVertexDoFs::set_index | ( | const unsigned int | level, | |
const unsigned int | dof_number, | |||
const unsigned int | dofs_per_vertex, | |||
const unsigned int | index | |||
) | [inline] |
Set the index with number dof_number
of this vertex on level
to the given index. To compute the position in the array, one has to specify how many dofs per vertex there are. It is not checked that the level number is below the number of the finest level this vertex lives on.
The function is inline, so should be reasonably fast.
References Assert, MGDoFHandler< dim, spacedim >::MGVertexDoFs::coarsest_level, MGDoFHandler< dim, spacedim >::MGVertexDoFs::finest_level, and MGDoFHandler< dim, spacedim >::MGVertexDoFs::indices.
unsigned int MGDoFHandler< dim, spacedim >::MGVertexDoFs::get_index | ( | const unsigned int | level, | |
const unsigned int | dof_number, | |||
const unsigned int | dofs_per_vertex | |||
) | const [inline] |
Return the index with number dof_number
of this vertex on level
. To compute the position in the array, one has to specify how many dofs per vertex there are. It is not checked that the level number is below the number of the finest level this vertex lives on.
The function is inline, so should be reasonably fast.
References Assert, MGDoFHandler< dim, spacedim >::MGVertexDoFs::coarsest_level, MGDoFHandler< dim, spacedim >::MGVertexDoFs::finest_level, and MGDoFHandler< dim, spacedim >::MGVertexDoFs::indices.
unsigned int MGDoFHandler< dim, spacedim >::MGVertexDoFs::get_coarsest_level | ( | ) | const |
Return the index of the coarsest level this vertex lives on.
unsigned int MGDoFHandler< dim, spacedim >::MGVertexDoFs::get_finest_level | ( | ) | const |
Return the index of the finest level this vertex lives on.
unsigned int MGDoFHandler< dim, spacedim >::MGVertexDoFs::coarsest_level [private] |
Store the coarsest level this vertex lives on. This is used as an offset when accessing the dofs of a specific level.
Referenced by MGDoFHandler< dim, spacedim >::MGVertexDoFs::get_index(), and MGDoFHandler< dim, spacedim >::MGVertexDoFs::set_index().
unsigned int MGDoFHandler< dim, spacedim >::MGVertexDoFs::finest_level [private] |
Finest level this level lives on. This is mostly used for error checking but can also be accessed by the function get_finest_level
.
Referenced by MGDoFHandler< dim, spacedim >::MGVertexDoFs::get_index(), and MGDoFHandler< dim, spacedim >::MGVertexDoFs::set_index().
unsigned int* MGDoFHandler< dim, spacedim >::MGVertexDoFs::indices [private] |
Array holding the indices.
Referenced by MGDoFHandler< dim, spacedim >::MGVertexDoFs::get_index(), and MGDoFHandler< dim, spacedim >::MGVertexDoFs::set_index().