this->present_level,
this->line_index (i),
this->dof_handler
- );
+ );
}
this->present_level,
l->index(),
this->dof_handler
- );
+ );
}
this->present_level,
this->quad_index (i),
this->dof_handler
- );
+ );
}
const unsigned int fe_index) const
{
return internal::hp::DoFLevel<0>::
- get_hp_vertex_dof_index (*this->dof_handler,
- this->vertex_index(vertex),
- fe_index,
- i);
+ get_vertex_dof_index (*this->dof_handler,
+ this->vertex_index(vertex),
+ fe_index,
+ i);
}
const unsigned int fe_index) const
{
return internal::hp::DoFLevel<0>::
- get_hp_vertex_dof_index (*this->dof_handler,
- this->vertex_index(vertex),
- fe_index,
- i);
+ get_vertex_dof_index (*this->dof_handler,
+ this->vertex_index(vertex),
+ fe_index,
+ i);
}
const unsigned int fe_index) const
{
return internal::hp::DoFLevel<0>::
- get_hp_vertex_dof_index (*this->dof_handler,
- this->vertex_index(vertex),
- fe_index,
- i);
+ get_vertex_dof_index (*this->dof_handler,
+ this->vertex_index(vertex),
+ fe_index,
+ i);
}
const unsigned int fe_index) const
{
return internal::hp::DoFLevel<0>::
- get_hp_vertex_dof_index (*this->dof_handler,
- this->vertex_index(vertex),
- fe_index,
- i);
+ get_vertex_dof_index (*this->dof_handler,
+ this->vertex_index(vertex),
+ fe_index,
+ i);
}
const unsigned int fe_index) const
{
return internal::hp::DoFLevel<0>::
- get_hp_vertex_dof_index (*this->dof_handler,
- this->vertex_index(vertex),
- fe_index,
- i);
+ get_vertex_dof_index (*this->dof_handler,
+ this->vertex_index(vertex),
+ fe_index,
+ i);
}
const unsigned int fe_index) const
{
return internal::hp::DoFLevel<0>::
- get_hp_vertex_dof_index (*this->dof_handler,
- this->vertex_index(vertex),
- fe_index,
- i);
+ get_vertex_dof_index (*this->dof_handler,
+ this->vertex_index(vertex),
+ fe_index,
+ i);
}
DoFObjectAccessor<1,hp::DoFHandler<1> >::dof_index (const unsigned int i,
const unsigned int fe_index) const
{
- Assert (fe_index != hp::DoFHandler<1>::default_fe_index,
- ExcMessage ("You need to specify a FE index when working with hp DoFHandlers"));
-
- // since the exception classes are
- // from a template dependent base
- // class, we have to fully qualify
- // them. to work around more
- // trouble, typedef the template
- // dependent base class to a
- // non-template dependent name and
- // use that to specify the
- // qualified exception names
- typedef DoFAccessor<hp::DoFHandler<1> > BaseClass;
-
- Assert (this->dof_handler != 0, BaseClass::ExcInvalidObject());
- Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
- ExcMessage ("DoFHandler not initialized"));
- // make sure a FE has been selected
- // and enough room was reserved
- Assert (&this->dof_handler->get_fe() != 0, BaseClass::ExcInvalidObject());
- Assert (i<this->dof_handler->get_fe()[fe_index].dofs_per_line,
- ExcIndexRange (i, 0, this->dof_handler->get_fe()[fe_index].dofs_per_line));
-
- // for lines in 1d, we only have to
- // take care of the offset, no
- // linked lists or whatever (see
- // hp::DoFLevels)
- const unsigned int offset = this->dof_handler->levels[this->present_level]
- ->dof_line_index_offset[this->present_index];
- Assert (offset != this->dof_handler->invalid_dof_index,
- ExcInternalError());
- Assert (offset+i <
- this->dof_handler->levels[this->present_level]->line_dofs.size(),
- ExcInternalError());
-
- return this->dof_handler->levels[this->present_level]->line_dofs[offset+i];
+ return this->dof_handler->levels[this->present_level]
+ ->get_line_dof_index (*this->dof_handler,
+ this->present_index,
+ fe_index,
+ i);
}
DoFObjectAccessor<1,hp::DoFHandler<2> >::dof_index (const unsigned int i,
const unsigned int fe_index) const
{
- Assert (fe_index != hp::DoFHandler<2>::default_fe_index,
- ExcMessage ("You need to specify a FE index when working with hp DoFHandlers"));
- // since the exception classes are
- // from a template dependent base
- // class, we have to fully qualify
- // them. to work around more
- // trouble, typedef the template
- // dependent base class to a
- // non-template dependent name and
- // use that to specify the
- // qualified exception names
- typedef DoFAccessor<hp::DoFHandler<2> > BaseClass;
-
- Assert (this->dof_handler != 0, BaseClass::ExcInvalidObject());
- Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
- ExcMessage ("DoFHandler not initialized"));
- // make sure a FE has been selected
- // and enough room was reserved
- Assert (&this->dof_handler->get_fe() != 0, BaseClass::ExcInvalidObject());
- Assert (i<this->dof_handler->get_fe()[fe_index].dofs_per_line,
- ExcIndexRange (i, 0, this->dof_handler->get_fe()[fe_index].dofs_per_line));
-
- const unsigned int offset = this->dof_handler->levels[this->present_level]
- ->dof_line_index_offset[this->present_index];
- Assert (offset != this->dof_handler->invalid_dof_index,
- ExcInternalError());
- Assert (offset+i <
- this->dof_handler->levels[this->present_level]->line_dofs.size(),
- ExcInternalError());
-
- return this->dof_handler->levels[this->present_level]->line_dofs[offset+i];
+ return this->dof_handler->levels[this->present_level]
+ ->get_line_dof_index (*this->dof_handler,
+ this->present_index,
+ fe_index,
+ i);
}
DoFObjectAccessor<1,hp::DoFHandler<3> >::dof_index (const unsigned int i,
const unsigned int fe_index) const
{
- Assert (fe_index != hp::DoFHandler<3>::default_fe_index,
- ExcMessage ("You need to specify a FE index when working with hp DoFHandlers"));
- // since the exception classes are
- // from a template dependent base
- // class, we have to fully qualify
- // them. to work around more
- // trouble, typedef the template
- // dependent base class to a
- // non-template dependent name and
- // use that to specify the
- // qualified exception names
- typedef DoFAccessor<hp::DoFHandler<3> > BaseClass;
-
- Assert (this->dof_handler != 0, BaseClass::ExcInvalidObject());
- Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
- ExcMessage ("DoFHandler not initialized"));
- // make sure a FE has been selected
- // and enough room was reserved
- Assert (&this->dof_handler->get_fe() != 0, BaseClass::ExcInvalidObject());
- Assert (i<this->dof_handler->get_fe()[fe_index].dofs_per_line,
- ExcIndexRange (i, 0, this->dof_handler->get_fe()[fe_index].dofs_per_line));
-
- const unsigned int offset = this->dof_handler->levels[this->present_level]
- ->dof_line_index_offset[this->present_index];
- Assert (offset != this->dof_handler->invalid_dof_index,
- ExcInternalError());
- Assert (offset+i <
- this->dof_handler->levels[this->present_level]->line_dofs.size(),
- ExcInternalError());
-
- return this->dof_handler->levels[this->present_level]->line_dofs[offset+i];
+ return this->dof_handler->levels[this->present_level]
+ ->get_line_dof_index (*this->dof_handler,
+ this->present_index,
+ fe_index,
+ i);
}
const unsigned int index,
const unsigned int fe_index) const
{
- Assert (fe_index != hp::DoFHandler<1>::default_fe_index,
- ExcMessage ("You need to specify a FE index when working with hp DoFHandlers"));
- typedef DoFAccessor<hp::DoFHandler<1> > BaseClass;
-
- Assert (this->dof_handler != 0,
- BaseClass::ExcInvalidObject());
- Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
- ExcMessage ("DoFHandler not initialized"));
- // make sure a FE has been selected
- // and enough room was reserved
- Assert (&this->dof_handler->get_fe() != 0,
- BaseClass::ExcInvalidObject());
- Assert (i<this->dof_handler->get_fe()[fe_index].dofs_per_line,
- ExcIndexRange (i, 0, this->dof_handler->get_fe()[fe_index].dofs_per_line));
-
- // for lines in 1d, we only have to
- // take care of the offset, no
- // linked lists or whatever (see
- // hp::DoFLevels)
- const unsigned int offset = this->dof_handler->levels[this->present_level]
- ->dof_line_index_offset[this->present_index];
- Assert (offset != this->dof_handler->invalid_dof_index,
- ExcInternalError());
- Assert (offset+i <
- this->dof_handler->levels[this->present_level]->line_dofs.size(),
- ExcInternalError());
-
- this->dof_handler->levels[this->present_level]->line_dofs[offset+i] = index;
+ this->dof_handler->levels[this->present_level]
+ ->set_line_dof_index (*this->dof_handler,
+ this->present_index,
+ fe_index,
+ i,
+ index);
}
const unsigned int index,
const unsigned int fe_index) const
{
- Assert (fe_index != hp::DoFHandler<2>::default_fe_index,
- ExcMessage ("You need to specify a FE index when working with hp DoFHandlers"));
- typedef DoFAccessor<hp::DoFHandler<2> > BaseClass;
-
- Assert (this->dof_handler != 0,
- BaseClass::ExcInvalidObject());
- Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
- ExcMessage ("DoFHandler not initialized"));
- // make sure a FE has been selected
- // and enough room was reserved
- Assert (&this->dof_handler->get_fe() != 0,
- BaseClass::ExcInvalidObject());
- Assert (i<this->dof_handler->get_fe()[fe_index].dofs_per_line,
- ExcIndexRange (i, 0, this->dof_handler->get_fe()[fe_index].dofs_per_line));
-
-//TODO:[?] In two dimension it could happen that we have different active_fe_indices
-// on a line between to cells. Hence we have to differentiate between these two cases.
-// Unfortunately, this requires more information then available now.
-
- const unsigned int offset = this->dof_handler->levels[this->present_level]
- ->dof_line_index_offset[this->present_index];
- Assert (offset != this->dof_handler->invalid_dof_index,
- ExcInternalError());
- Assert (offset+i <
- this->dof_handler->levels[this->present_level]->line_dofs.size(),
- ExcInternalError());
-
- this->dof_handler->levels[this->present_level]->line_dofs[offset+i] = index;
+ this->dof_handler->levels[this->present_level]
+ ->set_line_dof_index (*this->dof_handler,
+ this->present_index,
+ fe_index,
+ i,
+ index);
}
const unsigned int index,
const unsigned int fe_index) const
{
- Assert (fe_index != hp::DoFHandler<3>::default_fe_index,
- ExcMessage ("You need to specify a FE index when working with hp DoFHandlers"));
- typedef DoFAccessor<hp::DoFHandler<3> > BaseClass;
-
- Assert (this->dof_handler != 0,
- BaseClass::ExcInvalidObject());
- Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
- ExcMessage ("DoFHandler not initialized"));
- // make sure a FE has been selected
- // and enough room was reserved
- Assert (&this->dof_handler->get_fe() != 0,
- BaseClass::ExcInvalidObject());
- Assert (i<this->dof_handler->get_fe()[fe_index].dofs_per_line,
- ExcIndexRange (i, 0, this->dof_handler->get_fe()[fe_index].dofs_per_line));
-
- const unsigned int offset = this->dof_handler->levels[this->present_level]
- ->dof_line_index_offset[this->present_index];
- Assert (offset != this->dof_handler->invalid_dof_index,
- ExcInternalError());
- Assert (offset+i <
- this->dof_handler->levels[this->present_level]->line_dofs.size(),
- ExcInternalError());
-
- this->dof_handler->levels[this->present_level]->line_dofs[offset+i] = index;
+ this->dof_handler->levels[this->present_level]
+ ->set_line_dof_index (*this->dof_handler,
+ this->present_index,
+ fe_index,
+ i,
+ index);
}
unsigned int DoFObjectAccessor<2,hp::DoFHandler<2> >::dof_index (const unsigned int i,
const unsigned int fe_index) const
{
- Assert (fe_index != hp::DoFHandler<2>::default_fe_index,
- ExcMessage ("You need to specify a FE index when working with hp DoFHandlers"));
- typedef DoFAccessor<hp::DoFHandler<2> > BaseClass;
-
- Assert (this->dof_handler != 0,
- BaseClass::ExcInvalidObject());
- Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
- ExcMessage ("DoFHandler not initialized"));
- // make sure a FE has been selected
- // and enough room was reserved
- Assert (&this->dof_handler->get_fe() != 0,
- BaseClass::ExcInvalidObject());
- Assert (i<this->dof_handler->get_fe()[fe_index].dofs_per_quad,
- ExcIndexRange (i, 0, this->dof_handler->get_fe()[fe_index].dofs_per_quad));
-
- // for quads in 2d, we only have to
- // take care of the offset, no
- // linked lists or whatever (see
- // hp::DoFLevels)
- const unsigned int offset = this->dof_handler->levels[this->present_level]
- ->dof_quad_index_offset[this->present_index];
- Assert (offset != this->dof_handler->invalid_dof_index,
- ExcInternalError());
- Assert (offset+i <
- this->dof_handler->levels[this->present_level]->quad_dofs.size(),
- ExcInternalError());
-
- return this->dof_handler->levels[this->present_level]->quad_dofs[offset+i];
+ return this->dof_handler->levels[this->present_level]
+ ->get_quad_dof_index (*this->dof_handler,
+ this->present_index,
+ fe_index,
+ i);
}
unsigned int DoFObjectAccessor<2,hp::DoFHandler<3> >::dof_index (const unsigned int i,
const unsigned int fe_index) const
{
- Assert (fe_index != hp::DoFHandler<3>::default_fe_index,
- ExcMessage ("You need to specify a FE index when working with hp DoFHandlers"));
- typedef DoFAccessor<hp::DoFHandler<3> > BaseClass;
-
- Assert (this->dof_handler != 0,
- BaseClass::ExcInvalidObject());
- Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
- ExcMessage ("DoFHandler not initialized"));
- // make sure a FE has been selected
- // and enough room was reserved
- Assert (&this->dof_handler->get_fe() != 0,
- BaseClass::ExcInvalidObject());
- Assert (i<this->dof_handler->get_fe()[fe_index].dofs_per_quad,
- ExcIndexRange (i, 0, this->dof_handler->get_fe()[fe_index].dofs_per_quad));
-
- const unsigned int offset = this->dof_handler->levels[this->present_level]
- ->dof_quad_index_offset[this->present_index];
- Assert (offset != this->dof_handler->invalid_dof_index,
- ExcInternalError());
- Assert (offset+i <
- this->dof_handler->levels[this->present_level]->quad_dofs.size(),
- ExcInternalError());
-
- return this->dof_handler->levels[this->present_level]->quad_dofs[offset+i];
+ return this->dof_handler->levels[this->present_level]
+ ->get_quad_dof_index (*this->dof_handler,
+ this->present_index,
+ fe_index,
+ i);
}
const unsigned int index,
const unsigned int fe_index) const
{
- Assert (fe_index != hp::DoFHandler<2>::default_fe_index,
- ExcMessage ("You need to specify a FE index when working with hp DoFHandlers"));
- typedef DoFAccessor<hp::DoFHandler<2> > BaseClass;
-
- Assert (this->dof_handler != 0,
- BaseClass::ExcInvalidObject());
- Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
- ExcMessage ("DoFHandler not initialized"));
- // make sure a FE has been selected
- // and enough room was reserved
- Assert (&this->dof_handler->get_fe() != 0,
- BaseClass::ExcInvalidObject());
- Assert (i<this->dof_handler->get_fe()[fe_index].dofs_per_quad,
- ExcIndexRange (i, 0, this->dof_handler->get_fe()[fe_index].dofs_per_quad));
-
- // for quads in 2d, we only have to
- // take care of the offset, no
- // linked lists or whatever (see
- // hp::DoFLevels)
- const unsigned int offset = this->dof_handler->levels[this->present_level]
- ->dof_quad_index_offset[this->present_index];
- Assert (offset != this->dof_handler->invalid_dof_index,
- ExcInternalError());
- Assert (offset+i <
- this->dof_handler->levels[this->present_level]->quad_dofs.size(),
- ExcInternalError());
-
- this->dof_handler->levels[this->present_level]->quad_dofs[offset+i] = index;
+ this->dof_handler->levels[this->present_level]
+ ->set_quad_dof_index (*this->dof_handler,
+ this->present_index,
+ fe_index,
+ i,
+ index);
}
const unsigned int index,
const unsigned int fe_index) const
{
- Assert (fe_index != hp::DoFHandler<3>::default_fe_index,
- ExcMessage ("You need to specify a FE index when working with hp DoFHandlers"));
- typedef DoFAccessor<hp::DoFHandler<3> > BaseClass;
-
- Assert (this->dof_handler != 0,
- BaseClass::ExcInvalidObject());
- Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
- ExcMessage ("DoFHandler not initialized"));
- // make sure a FE has been selected
- // and enough room was reserved
- Assert (&this->dof_handler->get_fe() != 0,
- BaseClass::ExcInvalidObject());
- Assert (i<this->dof_handler->get_fe()[fe_index].dofs_per_quad,
- ExcIndexRange (i, 0, this->dof_handler->get_fe()[fe_index].dofs_per_quad));
-
- const unsigned int offset = this->dof_handler->levels[this->present_level]
- ->dof_quad_index_offset[this->present_index];
- Assert (offset != this->dof_handler->invalid_dof_index,
- ExcInternalError());
- Assert (offset+i <
- this->dof_handler->levels[this->present_level]->quad_dofs.size(),
- ExcInternalError());
-
- this->dof_handler->levels[this->present_level]->quad_dofs[offset+i] = index;
+ this->dof_handler->levels[this->present_level]
+ ->set_quad_dof_index (*this->dof_handler,
+ this->present_index,
+ fe_index,
+ i,
+ index);
}
DoFObjectAccessor<3,hp::DoFHandler<3> >::dof_index (const unsigned int i,
const unsigned int fe_index) const
{
- Assert (fe_index != hp::DoFHandler<3>::default_fe_index,
- ExcMessage ("You need to specify a FE index when working with hp DoFHandlers"));
- typedef DoFAccessor<hp::DoFHandler<3> > BaseClass;
-
- Assert (this->dof_handler != 0,
- BaseClass::ExcInvalidObject());
- Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
- ExcMessage ("DoFHandler not initialized"));
- // make sure a FE has been selected
- // and enough room was reserved
- Assert (&this->dof_handler->get_fe() != 0,
- BaseClass::ExcInvalidObject());
- Assert (i<this->dof_handler->get_fe()[fe_index].dofs_per_hex,
- ExcIndexRange (i, 0, this->dof_handler->get_fe()[fe_index].dofs_per_hex));
-
- // for hexes in 3d, we only have to
- // take care of the offset, no
- // linked lists or whatever (see
- // hp::DoFLevels)
- const unsigned int offset = this->dof_handler->levels[this->present_level]
- ->dof_hex_index_offset[this->present_index];
- Assert (offset != this->dof_handler->invalid_dof_index,
- ExcInternalError());
- Assert (offset+i <
- this->dof_handler->levels[this->present_level]->hex_dofs.size(),
- ExcInternalError());
-
- return this->dof_handler->levels[this->present_level]->hex_dofs[offset+i];
+ return this->dof_handler->levels[this->present_level]
+ ->get_hex_dof_index (*this->dof_handler,
+ this->present_index,
+ fe_index,
+ i);
}
const unsigned int index,
const unsigned int fe_index) const
{
- Assert (fe_index != hp::DoFHandler<3>::default_fe_index,
- ExcMessage ("You need to specify a FE index when working with hp DoFHandlers"));
- typedef DoFAccessor<hp::DoFHandler<3> > BaseClass;
-
- Assert (this->dof_handler != 0,
- BaseClass::ExcInvalidObject());
- Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
- ExcMessage ("DoFHandler not initialized"));
- // make sure a FE has been selected
- // and enough room was reserved
- Assert (&this->dof_handler->get_fe() != 0,
- BaseClass::ExcInvalidObject());
- Assert (i<this->dof_handler->get_fe()[fe_index].dofs_per_hex,
- ExcIndexRange (i, 0, this->dof_handler->get_fe()[fe_index].dofs_per_hex));
-
- // for hexes in 3d, we only have to
- // take care of the offset, no
- // linked lists or whatever (see
- // hp::DoFLevels)
- const unsigned int offset = this->dof_handler->levels[this->present_level]
- ->dof_hex_index_offset[this->present_index];
- Assert (offset != this->dof_handler->invalid_dof_index,
- ExcInternalError());
- Assert (offset+i <
- this->dof_handler->levels[this->present_level]->hex_dofs.size(),
- ExcInternalError());
-
- this->dof_handler->levels[this->present_level]->hex_dofs[offset+i] = index;
+ this->dof_handler->levels[this->present_level]
+ ->set_hex_dof_index (*this->dof_handler,
+ this->present_index,
+ fe_index,
+ i,
+ index);
}
template <int dim>
static
void
- set_hp_vertex_dof_index (::hp::DoFHandler<dim> &dof_handler,
- const unsigned int vertex_index,
- const unsigned int fe_index,
- const unsigned int local_index,
- const unsigned int global_index);
+ set_vertex_dof_index (::hp::DoFHandler<dim> &dof_handler,
+ const unsigned int vertex_index,
+ const unsigned int fe_index,
+ const unsigned int local_index,
+ const unsigned int global_index);
template <int dim>
static
unsigned int
- get_hp_vertex_dof_index (const ::hp::DoFHandler<dim> &dof_handler,
- const unsigned int vertex_index,
- const unsigned int fe_index,
- const unsigned int local_index);
+ get_vertex_dof_index (const ::hp::DoFHandler<dim> &dof_handler,
+ const unsigned int vertex_index,
+ const unsigned int fe_index,
+ const unsigned int local_index);
};
*/
std::vector<unsigned int> line_dofs;
+ template <int dim>
+ void
+ set_line_dof_index (const ::hp::DoFHandler<dim> &dof_handler,
+ const unsigned int line_index,
+ const unsigned int fe_index,
+ const unsigned int local_index,
+ const unsigned int global_index);
+
+ template <int dim>
+ unsigned int
+ get_line_dof_index (const ::hp::DoFHandler<dim> &dof_handler,
+ const unsigned int line_index,
+ const unsigned int fe_index,
+ const unsigned int local_index) const;
+
/**
* Determine an estimate for the
* memory consumption (in bytes)
*/
std::vector<unsigned int> quad_dofs;
+ template <int dim>
+ void
+ set_quad_dof_index (const ::hp::DoFHandler<dim> &dof_handler,
+ const unsigned int quad_index,
+ const unsigned int fe_index,
+ const unsigned int local_index,
+ const unsigned int global_index);
+
+ template <int dim>
+ unsigned int
+ get_quad_dof_index (const ::hp::DoFHandler<dim> &dof_handler,
+ const unsigned int quad_index,
+ const unsigned int fe_index,
+ const unsigned int local_index) const;
+
/**
* Determine an estimate for the
* memory consumption (in bytes)
*/
std::vector<unsigned int> hex_dofs;
+ template <int dim>
+ void
+ set_hex_dof_index (const ::hp::DoFHandler<dim> &dof_handler,
+ const unsigned int hex_index,
+ const unsigned int fe_index,
+ const unsigned int local_index,
+ const unsigned int global_index);
+
+ template <int dim>
+ unsigned int
+ get_hex_dof_index (const ::hp::DoFHandler<dim> &dof_handler,
+ const unsigned int hex_index,
+ const unsigned int fe_index,
+ const unsigned int local_index) const;
+
/**
* Determine an estimate for the
* memory consumption (in bytes)
void DoFObjectAccessor<1, DH>::set_vertex_dof_index (const unsigned int vertex,
const unsigned int i,
const unsigned int index,
- const unsigned int fe_index) const
+ const unsigned int fe_index) const
{
Assert (fe_index == DoFHandler<1>::default_fe_index,
DoFObjectAccessor<2, DH>::set_vertex_dof_index (const unsigned int vertex,
const unsigned int i,
const unsigned int index,
- const unsigned int fe_index) const
+ const unsigned int fe_index) const
{
Assert (fe_index == DoFHandler<1>::default_fe_index,
ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects"));
void DoFObjectAccessor<3, DH>::set_vertex_dof_index (const unsigned int vertex,
const unsigned int i,
const unsigned int index,
- const unsigned int fe_index) const
+ const unsigned int fe_index) const
{
Assert (fe_index == DoFHandler<1>::default_fe_index,
ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects"));
#if deal_II_dimension == 1
template <>
-void DoFObjectAccessor<1, hp::DoFHandler<1> >::set_vertex_dof_index (const unsigned int /*vertex*/,
- const unsigned int /*i*/,
- const unsigned int /*index*/,
- const unsigned int fe_index) const
+void DoFObjectAccessor<1, hp::DoFHandler<1> >::set_vertex_dof_index (const unsigned int vertex,
+ const unsigned int i,
+ const unsigned int index,
+ const unsigned int fe_index) const
{
- Assert (fe_index != hp::DoFHandler<1>::default_fe_index,
- ExcMessage ("You need to specify a FE index when working with hp DoFHandlers"));
- Assert (false, ExcInternalError());
+ internal::hp::DoFLevel<0>::set_vertex_dof_index (*this->dof_handler,
+ this->vertex_index(vertex),
+ fe_index,
+ i,
+ index);
}
template <>
#if deal_II_dimension == 2
template <>
-void DoFObjectAccessor<1, hp::DoFHandler<2> >::set_vertex_dof_index (const unsigned int /*vertex*/,
- const unsigned int /*i*/,
- const unsigned int /*index*/,
- const unsigned int fe_index) const
+void DoFObjectAccessor<1, hp::DoFHandler<2> >::set_vertex_dof_index (const unsigned int vertex,
+ const unsigned int i,
+ const unsigned int index,
+ const unsigned int fe_index) const
{
- Assert (fe_index != hp::DoFHandler<2>::default_fe_index,
- ExcMessage ("You need to specify a FE index when working with hp DoFHandlers"));
- Assert (false, ExcInternalError());
+ internal::hp::DoFLevel<0>::set_vertex_dof_index (*this->dof_handler,
+ this->vertex_index(vertex),
+ fe_index,
+ i,
+ index);
}
template <>
-void DoFObjectAccessor<2, hp::DoFHandler<2> >::set_vertex_dof_index (const unsigned int /*vertex*/,
- const unsigned int /*i*/,
- const unsigned int /*index*/,
- const unsigned int fe_index) const
+void DoFObjectAccessor<2, hp::DoFHandler<2> >::set_vertex_dof_index (const unsigned int vertex,
+ const unsigned int i,
+ const unsigned int index,
+ const unsigned int fe_index) const
{
- Assert (fe_index != hp::DoFHandler<2>::default_fe_index,
- ExcMessage ("You need to specify a FE index when working with hp DoFHandlers"));
- Assert (false, ExcInternalError());
+ internal::hp::DoFLevel<0>::set_vertex_dof_index (*this->dof_handler,
+ this->vertex_index(vertex),
+ fe_index,
+ i,
+ index);
}
template <>
#if deal_II_dimension == 3
template <>
-void DoFObjectAccessor<1, hp::DoFHandler<3> >::set_vertex_dof_index (const unsigned int /*vertex*/,
- const unsigned int /*i*/,
- const unsigned int /*index*/,
- const unsigned int fe_index) const
+void DoFObjectAccessor<1, hp::DoFHandler<3> >::set_vertex_dof_index (const unsigned int vertex,
+ const unsigned int i,
+ const unsigned int index,
+ const unsigned int fe_index) const
{
- Assert (fe_index != hp::DoFHandler<3>::default_fe_index,
- ExcMessage ("You need to specify a FE index when working with hp DoFHandlers"));
- Assert (false, ExcInternalError());
+ internal::hp::DoFLevel<0>::set_vertex_dof_index (*this->dof_handler,
+ this->vertex_index(vertex),
+ fe_index,
+ i,
+ index);
}
template <>
-void DoFObjectAccessor<2, hp::DoFHandler<3> >::set_vertex_dof_index (const unsigned int /*vertex*/,
- const unsigned int /*i*/,
- const unsigned int /*index*/,
- const unsigned int fe_index) const
+void DoFObjectAccessor<2, hp::DoFHandler<3> >::set_vertex_dof_index (const unsigned int vertex,
+ const unsigned int i,
+ const unsigned int index,
+ const unsigned int fe_index) const
{
- Assert (fe_index != hp::DoFHandler<3>::default_fe_index,
- ExcMessage ("You need to specify a FE index when working with hp DoFHandlers"));
- Assert (false, ExcInternalError());
+ internal::hp::DoFLevel<0>::set_vertex_dof_index (*this->dof_handler,
+ this->vertex_index(vertex),
+ fe_index,
+ i,
+ index);
}
template <>
-void DoFObjectAccessor<3, hp::DoFHandler<3> >::set_vertex_dof_index (const unsigned int /*vertex*/,
- const unsigned int /*i*/,
- const unsigned int /*index*/,
- const unsigned int fe_index) const
+void DoFObjectAccessor<3, hp::DoFHandler<3> >::set_vertex_dof_index (const unsigned int vertex,
+ const unsigned int i,
+ const unsigned int index,
+ const unsigned int fe_index) const
{
- Assert (fe_index != hp::DoFHandler<3>::default_fe_index,
- ExcMessage ("You need to specify a FE index when working with hp DoFHandlers"));
- Assert (false, ExcInternalError());
+ internal::hp::DoFLevel<0>::set_vertex_dof_index (*this->dof_handler,
+ this->vertex_index(vertex),
+ fe_index,
+ i,
+ index);
}
template <int dim>
unsigned int
DoFLevel<0>::
- get_hp_vertex_dof_index (const ::hp::DoFHandler<dim> &dof_handler,
- const unsigned int vertex_index,
- const unsigned int fe_index,
- const unsigned int local_index)
+ get_vertex_dof_index (const ::hp::DoFHandler<dim> &dof_handler,
+ const unsigned int vertex_index,
+ const unsigned int fe_index,
+ const unsigned int local_index)
{
Assert (fe_index != ::hp::DoFHandler<dim>::default_fe_index,
ExcMessage ("You need to specify a FE index when working "
template <int dim>
void
DoFLevel<0>::
- set_hp_vertex_dof_index (::hp::DoFHandler<dim> &dof_handler,
- const unsigned int vertex_index,
- const unsigned int fe_index,
- const unsigned int local_index,
- const unsigned int global_index)
+ set_vertex_dof_index (::hp::DoFHandler<dim> &dof_handler,
+ const unsigned int vertex_index,
+ const unsigned int fe_index,
+ const unsigned int local_index,
+ const unsigned int global_index)
{
Assert (fe_index != ::hp::DoFHandler<dim>::default_fe_index,
ExcMessage ("You need to specify a FE index when working "
}
}
+
+
+ template <int dim>
+ unsigned int
+ DoFLevel<1>::
+ get_line_dof_index (const ::hp::DoFHandler<dim> &dof_handler,
+ const unsigned int line_index,
+ const unsigned int fe_index,
+ const unsigned int local_index) const
+ {
+ Assert (fe_index != ::hp::DoFHandler<dim>::default_fe_index,
+ ExcMessage ("You need to specify a FE index when working "
+ "with hp DoFHandlers"));
+ Assert (&dof_handler != 0,
+ ExcMessage ("No DoFHandler is specified for this iterator"));
+ Assert (&dof_handler.get_fe() != 0,
+ ExcMessage ("No finite element collection is associated with "
+ "this DoFHandler"));
+ Assert (local_index < dof_handler.get_fe()[fe_index].dofs_per_line,
+ ExcIndexRange(local_index, 0,
+ dof_handler.get_fe()[fe_index].dofs_per_line));
+
+ // if we are in 1d, then the
+ // only set of indices we store
+ // is the one for the cell,
+ // which is unique. then
+ // fe_index must be
+ // active_fe_index
+ if (dim == 1)
+ {
+ Assert (fe_index == this->active_fe_indices[line_index],
+ ExcMessage ("FE index does not match that of the present cell"));
+ return line_dofs[dof_line_index_offset[line_index]+local_index];
+ }
+ else
+ {
+ // we are in higher space
+ // dimensions, so there may
+ // be multiple finite
+ // elements associated with
+ // this object. hop along
+ // the list of index sets
+ // until we find the one
+ // with the correct
+ // fe_index, and then poke
+ // into that part. trigger
+ // an exception if we can't
+ // find a set for this
+ // particular fe_index
+ const unsigned int starting_offset = dof_line_index_offset[line_index];
+ const unsigned int *pointer = &line_dofs[starting_offset];
+ while (true)
+ {
+ Assert (*pointer != deal_II_numbers::invalid_unsigned_int,
+ ExcInternalError());
+ if (*pointer == fe_index)
+ return *(pointer + 1 + local_index);
+ else
+ pointer += dof_handler.get_fe()[*pointer].dofs_per_line;
+ }
+ }
+ }
+
+
+
+ template <int dim>
+ void
+ DoFLevel<1>::
+ set_line_dof_index (const ::hp::DoFHandler<dim> &dof_handler,
+ const unsigned int line_index,
+ const unsigned int fe_index,
+ const unsigned int local_index,
+ const unsigned int global_index)
+ {
+ Assert (fe_index != ::hp::DoFHandler<dim>::default_fe_index,
+ ExcMessage ("You need to specify a FE index when working "
+ "with hp DoFHandlers"));
+ Assert (&dof_handler != 0,
+ ExcMessage ("No DoFHandler is specified for this iterator"));
+ Assert (&dof_handler.get_fe() != 0,
+ ExcMessage ("No finite element collection is associated with "
+ "this DoFHandler"));
+ Assert (local_index < dof_handler.get_fe()[fe_index].dofs_per_line,
+ ExcIndexRange(local_index, 0,
+ dof_handler.get_fe()[fe_index].dofs_per_line));
+
+ // if we are in 1d, then the
+ // only set of indices we store
+ // is the one for the cell,
+ // which is unique. then
+ // fe_index must be
+ // active_fe_index
+ if (dim == 1)
+ {
+ Assert (fe_index == this->active_fe_indices[line_index],
+ ExcMessage ("FE index does not match that of the present cell"));
+ line_dofs[dof_line_index_offset[line_index]+local_index] = global_index;
+ }
+ else
+ {
+ // we are in higher space
+ // dimensions, so there may
+ // be multiple finite
+ // elements associated with
+ // this object. hop along
+ // the list of index sets
+ // until we find the one
+ // with the correct
+ // fe_index, and then poke
+ // into that part. trigger
+ // an exception if we can't
+ // find a set for this
+ // particular fe_index
+ const unsigned int starting_offset = dof_line_index_offset[line_index];
+ unsigned int *pointer = &line_dofs[starting_offset];
+ while (true)
+ {
+ Assert (*pointer != deal_II_numbers::invalid_unsigned_int,
+ ExcInternalError());
+ if (*pointer == fe_index)
+ {
+ *(pointer + 1 + local_index) = global_index;
+ return;
+ }
+ else
+ pointer += dof_handler.get_fe()[*pointer].dofs_per_line;
+ }
+ }
+ }
+
+
+
+ template <int dim>
+ unsigned int
+ DoFLevel<2>::
+ get_quad_dof_index (const ::hp::DoFHandler<dim> &dof_handler,
+ const unsigned int quad_index,
+ const unsigned int fe_index,
+ const unsigned int local_index) const
+ {
+ Assert (dim >= 2, ExcMessage ("You can only access quads in 2d or higher"));
+ Assert (fe_index != ::hp::DoFHandler<dim>::default_fe_index,
+ ExcMessage ("You need to specify a FE index when working "
+ "with hp DoFHandlers"));
+ Assert (&dof_handler != 0,
+ ExcMessage ("No DoFHandler is specified for this iterator"));
+ Assert (&dof_handler.get_fe() != 0,
+ ExcMessage ("No finite element collection is associated with "
+ "this DoFHandler"));
+ Assert (local_index < dof_handler.get_fe()[fe_index].dofs_per_quad,
+ ExcIndexRange(local_index, 0,
+ dof_handler.get_fe()[fe_index].dofs_per_quad));
+
+ // if we are in 1d, then the
+ // only set of indices we store
+ // is the one for the cell,
+ // which is unique. then
+ // fe_index must be
+ // active_fe_index
+ if (dim == 2)
+ {
+ Assert (fe_index == this->active_fe_indices[quad_index],
+ ExcMessage ("FE index does not match that of the present cell"));
+ return quad_dofs[dof_quad_index_offset[quad_index]+local_index];
+ }
+ else
+ {
+ // we are in higher space
+ // dimensions, so there may
+ // be multiple finite
+ // elements associated with
+ // this object. hop along
+ // the list of index sets
+ // until we find the one
+ // with the correct
+ // fe_index, and then poke
+ // into that part. trigger
+ // an exception if we can't
+ // find a set for this
+ // particular fe_index
+ const unsigned int starting_offset = dof_quad_index_offset[quad_index];
+ const unsigned int *pointer = &quad_dofs[starting_offset];
+ while (true)
+ {
+ Assert (*pointer != deal_II_numbers::invalid_unsigned_int,
+ ExcInternalError());
+ if (*pointer == fe_index)
+ return *(pointer + 1 + local_index);
+ else
+ pointer += dof_handler.get_fe()[*pointer].dofs_per_quad;
+ }
+ }
+ }
+
+
+
+ template <int dim>
+ void
+ DoFLevel<2>::
+ set_quad_dof_index (const ::hp::DoFHandler<dim> &dof_handler,
+ const unsigned int quad_index,
+ const unsigned int fe_index,
+ const unsigned int local_index,
+ const unsigned int global_index)
+ {
+ Assert (dim >= 2, ExcMessage ("You can only access quads in 2d or higher"));
+ Assert (fe_index != ::hp::DoFHandler<dim>::default_fe_index,
+ ExcMessage ("You need to specify a FE index when working "
+ "with hp DoFHandlers"));
+ Assert (&dof_handler != 0,
+ ExcMessage ("No DoFHandler is specified for this iterator"));
+ Assert (&dof_handler.get_fe() != 0,
+ ExcMessage ("No finite element collection is associated with "
+ "this DoFHandler"));
+ Assert (local_index < dof_handler.get_fe()[fe_index].dofs_per_quad,
+ ExcIndexRange(local_index, 0,
+ dof_handler.get_fe()[fe_index].dofs_per_quad));
+
+ // if we are in 1d, then the
+ // only set of indices we store
+ // is the one for the cell,
+ // which is unique. then
+ // fe_index must be
+ // active_fe_index
+ if (dim == 2)
+ {
+ Assert (fe_index == this->active_fe_indices[quad_index],
+ ExcMessage ("FE index does not match that of the present cell"));
+ quad_dofs[dof_quad_index_offset[quad_index]+local_index] = global_index;
+ }
+ else
+ {
+ // we are in higher space
+ // dimensions, so there may
+ // be multiple finite
+ // elements associated with
+ // this object. hop along
+ // the list of index sets
+ // until we find the one
+ // with the correct
+ // fe_index, and then poke
+ // into that part. trigger
+ // an exception if we can't
+ // find a set for this
+ // particular fe_index
+ const unsigned int starting_offset = dof_quad_index_offset[quad_index];
+ unsigned int *pointer = &quad_dofs[starting_offset];
+ while (true)
+ {
+ Assert (*pointer != deal_II_numbers::invalid_unsigned_int,
+ ExcInternalError());
+ if (*pointer == fe_index)
+ {
+ *(pointer + 1 + local_index) = global_index;
+ return;
+ }
+ else
+ pointer += dof_handler.get_fe()[*pointer].dofs_per_quad;
+ }
+ }
+ }
+
+
+
+ template <int dim>
+ unsigned int
+ DoFLevel<3>::
+ get_hex_dof_index (const ::hp::DoFHandler<dim> &dof_handler,
+ const unsigned int hex_index,
+ const unsigned int fe_index,
+ const unsigned int local_index) const
+ {
+ Assert (dim >= 3, ExcMessage ("You can only access hexs in 3d or higher"));
+ Assert (fe_index != ::hp::DoFHandler<dim>::default_fe_index,
+ ExcMessage ("You need to specify a FE index when working "
+ "with hp DoFHandlers"));
+ Assert (&dof_handler != 0,
+ ExcMessage ("No DoFHandler is specified for this iterator"));
+ Assert (&dof_handler.get_fe() != 0,
+ ExcMessage ("No finite element collection is associated with "
+ "this DoFHandler"));
+ Assert (local_index < dof_handler.get_fe()[fe_index].dofs_per_hex,
+ ExcIndexRange(local_index, 0,
+ dof_handler.get_fe()[fe_index].dofs_per_hex));
+
+ // if we are in 1d, then the
+ // only set of indices we store
+ // is the one for the cell,
+ // which is unique. then
+ // fe_index must be
+ // active_fe_index
+ if (dim == 3)
+ {
+ Assert (fe_index == this->active_fe_indices[hex_index],
+ ExcMessage ("FE index does not match that of the present cell"));
+ return hex_dofs[dof_hex_index_offset[hex_index]+local_index];
+ }
+ else
+ {
+ // we are in higher space
+ // dimensions, so there may
+ // be multiple finite
+ // elements associated with
+ // this object. hop along
+ // the list of index sets
+ // until we find the one
+ // with the correct
+ // fe_index, and then poke
+ // into that part. trigger
+ // an exception if we can't
+ // find a set for this
+ // particular fe_index
+ const unsigned int starting_offset = dof_hex_index_offset[hex_index];
+ const unsigned int *pointer = &hex_dofs[starting_offset];
+ while (true)
+ {
+ Assert (*pointer != deal_II_numbers::invalid_unsigned_int,
+ ExcInternalError());
+ if (*pointer == fe_index)
+ return *(pointer + 1 + local_index);
+ else
+ pointer += dof_handler.get_fe()[*pointer].dofs_per_hex;
+ }
+ }
+ }
+
+
+
+ template <int dim>
+ void
+ DoFLevel<3>::
+ set_hex_dof_index (const ::hp::DoFHandler<dim> &dof_handler,
+ const unsigned int hex_index,
+ const unsigned int fe_index,
+ const unsigned int local_index,
+ const unsigned int global_index)
+ {
+ Assert (dim >= 3, ExcMessage ("You can only access hexs in 3d or higher"));
+ Assert (fe_index != ::hp::DoFHandler<dim>::default_fe_index,
+ ExcMessage ("You need to specify a FE index when working "
+ "with hp DoFHandlers"));
+ Assert (&dof_handler != 0,
+ ExcMessage ("No DoFHandler is specified for this iterator"));
+ Assert (&dof_handler.get_fe() != 0,
+ ExcMessage ("No finite element collection is associated with "
+ "this DoFHandler"));
+ Assert (local_index < dof_handler.get_fe()[fe_index].dofs_per_hex,
+ ExcIndexRange(local_index, 0,
+ dof_handler.get_fe()[fe_index].dofs_per_hex));
+
+ // if we are in 1d, then the
+ // only set of indices we store
+ // is the one for the cell,
+ // which is unique. then
+ // fe_index must be
+ // active_fe_index
+ if (dim == 3)
+ {
+ Assert (fe_index == this->active_fe_indices[hex_index],
+ ExcMessage ("FE index does not match that of the present cell"));
+ hex_dofs[dof_hex_index_offset[hex_index]+local_index] = global_index;
+ }
+ else
+ {
+ // we are in higher space
+ // dimensions, so there may
+ // be multiple finite
+ // elements associated with
+ // this object. hop along
+ // the list of index sets
+ // until we find the one
+ // with the correct
+ // fe_index, and then poke
+ // into that part. trigger
+ // an exception if we can't
+ // find a set for this
+ // particular fe_index
+ const unsigned int starting_offset = dof_hex_index_offset[hex_index];
+ unsigned int *pointer = &hex_dofs[starting_offset];
+ while (true)
+ {
+ Assert (*pointer != deal_II_numbers::invalid_unsigned_int,
+ ExcInternalError());
+ if (*pointer == fe_index)
+ {
+ *(pointer + 1 + local_index) = global_index;
+ return;
+ }
+ else
+ pointer += dof_handler.get_fe()[*pointer].dofs_per_hex;
+ }
+ }
+ }
+
// explicit instantiations
template
unsigned int
DoFLevel<0>::
- get_hp_vertex_dof_index (const ::hp::DoFHandler<deal_II_dimension> &dof_handler,
- const unsigned int vertex_index,
- const unsigned int fe_index,
- const unsigned int local_index);
+ get_vertex_dof_index (const ::hp::DoFHandler<deal_II_dimension> &dof_handler,
+ const unsigned int vertex_index,
+ const unsigned int fe_index,
+ const unsigned int local_index);
template
void
DoFLevel<0>::
- set_hp_vertex_dof_index (::hp::DoFHandler<deal_II_dimension> &dof_handler,
- const unsigned int vertex_index,
- const unsigned int fe_index,
- const unsigned int local_index,
- const unsigned int global_index);
+ set_vertex_dof_index (::hp::DoFHandler<deal_II_dimension> &dof_handler,
+ const unsigned int vertex_index,
+ const unsigned int fe_index,
+ const unsigned int local_index,
+ const unsigned int global_index);
+
+ template
+ unsigned int
+ DoFLevel<1>::
+ get_line_dof_index (const ::hp::DoFHandler<deal_II_dimension> &dof_handler,
+ const unsigned int line_index,
+ const unsigned int fe_index,
+ const unsigned int local_index) const;
+
+ template
+ void
+ DoFLevel<1>::
+ set_line_dof_index (const ::hp::DoFHandler<deal_II_dimension> &dof_handler,
+ const unsigned int line_index,
+ const unsigned int fe_index,
+ const unsigned int local_index,
+ const unsigned int global_index);
+
+#if deal_II_dimension >= 2
+
+ template
+ unsigned int
+ DoFLevel<2>::
+ get_quad_dof_index (const ::hp::DoFHandler<deal_II_dimension> &dof_handler,
+ const unsigned int quad_index,
+ const unsigned int fe_index,
+ const unsigned int local_index) const;
+
+ template
+ void
+ DoFLevel<2>::
+ set_quad_dof_index (const ::hp::DoFHandler<deal_II_dimension> &dof_handler,
+ const unsigned int quad_index,
+ const unsigned int fe_index,
+ const unsigned int local_index,
+ const unsigned int global_index);
+
+#endif
+
+#if deal_II_dimension >= 3
+
+ template
+ unsigned int
+ DoFLevel<3>::
+ get_hex_dof_index (const ::hp::DoFHandler<deal_II_dimension> &dof_handler,
+ const unsigned int hex_index,
+ const unsigned int fe_index,
+ const unsigned int local_index) const;
+
+ template
+ void
+ DoFLevel<3>::
+ set_hex_dof_index (const ::hp::DoFHandler<deal_II_dimension> &dof_handler,
+ const unsigned int hex_index,
+ const unsigned int fe_index,
+ const unsigned int local_index,
+ const unsigned int global_index);
+
+#endif
}
}