// $Id$
// Version: $Name$
//
-// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 by the deal.II authors
+// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
const FiniteElement<1> &
DoFObjectAccessor<1,1,hp::DoFHandler>::get_fe () const
{
- return dof_handler->finite_elements->get_fe(active_fe_index ());
+ return (*dof_handler->finite_elements)[active_fe_index ()];
}
template <>
inline
const FiniteElement<2> &
DoFObjectAccessor<1,2,hp::DoFHandler>::get_fe () const
{
- return dof_handler->finite_elements->get_fe(active_fe_index ());
+ return (*dof_handler->finite_elements)[active_fe_index ()];
}
template <>
inline
const FiniteElement<3> &
DoFObjectAccessor<1,3,hp::DoFHandler>::get_fe () const
{
- return dof_handler->finite_elements->get_fe(active_fe_index ());
+ return (*dof_handler->finite_elements)[active_fe_index ()];
}
const FiniteElement<2> &
DoFObjectAccessor<2,2,hp::DoFHandler>::get_fe () const
{
- return dof_handler->finite_elements->get_fe(active_fe_index ());
+ return (*dof_handler->finite_elements)[active_fe_index ()];
}
const FiniteElement<3> &
DoFObjectAccessor<2,3,hp::DoFHandler>::get_fe () const
{
- return dof_handler->finite_elements->get_fe(active_fe_index ());
+ return (*dof_handler->finite_elements)[active_fe_index ()];
}
const FiniteElement<3> &
DoFObjectAccessor<3,3,hp::DoFHandler>::get_fe () const
{
- return dof_handler->finite_elements->get_fe(active_fe_index ());
+ return (*dof_handler->finite_elements)[active_fe_index ()];
}
* collection.
*/
const FiniteElement<dim> &
- get_fe (const unsigned int index) const;
+ operator[] (const unsigned int index) const;
/**
* Return the number of finite element
* objects stored in this collection.
*/
- unsigned int n_finite_elements () const;
+ unsigned int size () const;
/**
* Return the number of vector
template <int dim>
inline
unsigned int
- FECollection<dim>::n_finite_elements () const
+ FECollection<dim>::size () const
{
return finite_elements.size();
}
template <int dim>
inline
const FiniteElement<dim> &
- FECollection<dim>::get_fe (const unsigned int index) const
+ FECollection<dim>::operator[] (const unsigned int index) const
{
Assert (index < finite_elements.size(),
ExcIndexRange (index, 0, finite_elements.size()));
const Table<2, Coupling>& table,
std::vector<Table<2,Coupling> >& tables_by_block)
{
- const hp::FECollection<dim>& coll = dof_handler.get_fe();
- tables_by_block.resize(coll.n_finite_elements());
+ const hp::FECollection<dim>& fe_collection = dof_handler.get_fe();
+ tables_by_block.resize(fe_collection.size());
- for (unsigned int f=0;f<coll.n_finite_elements();++f)
+ for (unsigned int f=0;f<fe_collection.size();++f)
{
- const FiniteElement<dim>& fe = coll.get_fe(f);
+ const FiniteElement<dim>& fe = fe_collection[f];
const unsigned int nb = fe.n_blocks();
tables_by_block[f].reinit(nb, nb);
// their size
clear_space ();
- vertex_dofs.resize(tria->vertices.size()*finite_elements->get_fe(0).dofs_per_vertex,
+ vertex_dofs.resize(tria->vertices.size()*(*finite_elements)[0].dofs_per_vertex,
invalid_dof_index);
for (unsigned int i=0; i<tria->n_levels(); ++i)
for (unsigned int j = 0; j < tria->levels[i]->lines.lines.size(); ++j)
{
levels.back()->dof_line_index_offset[j] = dofs_for_lines;
- dofs_for_lines += finite_elements->
- get_fe (levels.back ()->active_fe_indices[j]).dofs_per_line;
+ dofs_for_lines += (*finite_elements)[
+ levels.back ()->active_fe_indices[j]].dofs_per_line;
}
levels.back()->line_dofs = std::vector<unsigned int>(dofs_for_lines,
// their size
clear_space ();
- vertex_dofs.resize(tria->vertices.size()*finite_elements->get_fe(0).dofs_per_vertex,
+ vertex_dofs.resize(tria->vertices.size()*(*finite_elements)[0].dofs_per_vertex,
invalid_dof_index);
//TODO[?] Does not work for continuous FEs. Problem is at faces, which might have a different
active_fe2 = active_fe1;
if (active_fe1 == active_fe2)
- dofs_for_lines += finite_elements->get_fe (active_fe1).dofs_per_line + 2;
+ dofs_for_lines += (*finite_elements)[active_fe1].dofs_per_line + 2;
else
- dofs_for_lines += finite_elements->get_fe (active_fe1).dofs_per_line +
- finite_elements->get_fe (active_fe2).dofs_per_line + 4;
+ dofs_for_lines += (*finite_elements)[active_fe1].dofs_per_line +
+ (*finite_elements)[active_fe2].dofs_per_line + 4;
}
unsigned int dofs_for_quads = 0;
for (unsigned int j = 0; j < tria->levels[i]->quads.quads.size (); ++j)
{
levels.back()->dof_quad_index_offset[j] = dofs_for_quads;
- dofs_for_quads += finite_elements->
- get_fe (levels.back ()->active_fe_indices[j]).dofs_per_quad;
+ dofs_for_quads += (*finite_elements)[
+ levels.back ()->active_fe_indices[j]].dofs_per_quad;
}
levels.back()->line_dofs = std::vector<unsigned int> (dofs_for_lines,
static_cast<unsigned int>(-1);
else
{
- unsigned int start_next_fe = dofs_for_lines +
- finite_elements->get_fe (active_fe1).dofs_per_line + 2;
+ const unsigned int start_next_fe =
+ dofs_for_lines + (*finite_elements)[active_fe1].dofs_per_line + 2;
levels.back()->line_dofs[dofs_for_lines + 1] = start_next_fe;
// their size
clear_space ();
- vertex_dofs.resize(tria->vertices.size()*finite_elements->get_fe(0).dofs_per_vertex,
+ vertex_dofs.resize(tria->vertices.size()*(*finite_elements)[0].dofs_per_vertex,
invalid_dof_index);
//TODO[?] Does not work for continuous FEs. Problem is at faces, which might have a different
for (unsigned int j=0; j<tria->levels[i]->hexes.hexes.size(); ++j)
{
levels.back()->dof_hex_index_offset[j] = dofs_for_hexes;
- dofs_for_hexes += finite_elements->
- get_fe (levels.back ()->active_fe_indices[j]).dofs_per_hex;
+ dofs_for_hexes += (*finite_elements)[
+ levels.back ()->active_fe_indices[j]].dofs_per_hex;
}
levels.back()->line_dofs = std::vector<unsigned int> (dofs_for_lines,
// used by the DoFHandler used by
// this cell, are the same
Assert (static_cast<const FiniteElementData<dim>&>(*this->fe) ==
- static_cast<const FiniteElementData<dim>&>(cell->get_dof_handler().get_fe().get_fe (cell->active_fe_index ())),
+ static_cast<const FiniteElementData<dim>&>(
+ cell->get_dof_handler().get_fe()[cell->active_fe_index ()]),
typename FEValuesBase<dim>::ExcFEDontMatch());
Assert (face_no < GeometryInfo<dim>::faces_per_cell,
// used by the hp::DoFHandler used by
// this cell, are the same
Assert (static_cast<const FiniteElementData<dim>&>(*this->fe) ==
- static_cast<const FiniteElementData<dim>&>(cell->get_dof_handler().get_fe().get_fe (cell->active_fe_index ())),
+ static_cast<const FiniteElementData<dim>&>(
+ cell->get_dof_handler().get_fe()[cell->active_fe_index ()]),
typename FEValuesBase<dim>::ExcFEDontMatch());
Assert (face_no < GeometryInfo<dim>::faces_per_cell,
ExcIndexRange (face_no, 0, GeometryInfo<dim>::faces_per_cell));