template <typename number> class Vector;
template <int dim> class DoFHandler;
+template <int dim> class hpDoFHandler;
template <int dim> class FiniteElement;
-template <int celldim, int dim> class DoFObjectAccessor;
-template <int dim> class DoFObjectAccessor<0, dim>;
-template <int dim> class DoFObjectAccessor<1, dim>;
-template <int dim> class DoFObjectAccessor<2, dim>;
-template <int dim> class DoFObjectAccessor<3, dim>;
+template <int celldim, int dim, template <int> class DH> class DoFObjectAccessor;
+template <int dim, template <int> class DH> class DoFObjectAccessor<0, dim, DH>;
+template <int dim, template <int> class DH> class DoFObjectAccessor<1, dim, DH>;
+template <int dim, template <int> class DH> class DoFObjectAccessor<2, dim, DH>;
+template <int dim, template <int> class DH> class DoFObjectAccessor<3, dim, DH>;
template <int dim, typename Accessor> class TriaRawIterator;
* @ingroup Accessors
* @author Wolfgang Bangerth, 1998
*/
-template <int dim>
+template <int dim, template <int> class DH>
class DoFAccessor
{
public:
* non-const, even if they preserve
* constness.
*/
- DoFAccessor (const DoFHandler<dim> *dof_handler);
+ DoFAccessor (const DH<dim> *dof_handler);
/**
* Reset the DoF handler pointer.
*/
- void set_dof_handler (DoFHandler<dim> *dh);
+ void set_dof_handler (DH<dim> *dh);
/**
* Return a handle on the
* DoFHandler object which we
* are using.
*/
- const DoFHandler<dim> &
+ const DH<dim> &
get_dof_handler () const;
- /**
- * Return the finite element that
- * is used on the cell pointed to
- * by this iterator.
- */
- const FiniteElement<dim> &
- get_fe () const;
-
/**
* Copy operator.
*/
- DoFAccessor<dim> &
- operator = (const DoFAccessor<dim> &da);
-
+ DoFAccessor<dim, DH> &
+ operator = (const DoFAccessor<dim, DH> &da);
+
/**
* Exception for child classes
*
* Store the address of the DoFHandler object
* to be accessed.
*/
- DoFHandler<dim> *dof_handler;
+ DH<dim> *dof_handler;
};
* @ingroup dofs
* @ingroup Accessors
*/
-template<int celldim, int dim>
-class DoFObjectAccessor : public DoFAccessor<dim>,
+template<int celldim, int dim, template <int> class DH>
+class DoFObjectAccessor : public DoFAccessor<dim, DH>,
public TriaObjectAccessor<celldim,dim>
{
public:
/**
* Data type passed by the iterator class.
*/
- typedef DoFHandler<dim> AccessorData;
+ typedef DH<dim> AccessorData;
/**
* Declare base class as a local typedef
* for simpler access.
*/
typedef TriaObjectAccessor<celldim,dim> BaseClass;
-
+
+
/**
* Default constructor. Unused, thus
* not implemented.
template <class OutputVector, typename number>
void set_dof_values (const Vector<number> &local_values,
OutputVector &values) const;
+
+
+ /**
+ * Return the finite element that
+ * is used on the cell pointed to
+ * by this iterator. For non-hp
+ * DoF handlers, this is of
+ * course always the same
+ * element, independent of the
+ * cell we are presently on, but
+ * for hp DoF handlers, this may
+ * change from cell to cell.
+ */
+ const FiniteElement<dim> &
+ get_fe () const;
+
+ /**
+ * Returns the index inside the FECollection
+ * of the FiniteElement used for this cell.
+ */
+ unsigned int active_fe_index () const;
+
+ /**
+ * Sets the index of the FiniteElement used for
+ * this cell.
+ */
+ void set_active_fe_index (const unsigned int i);
+
/**
* Pointer to the <i>i</i>th line
* bounding this Object.
*/
- TriaIterator<dim,DoFObjectAccessor<1, dim> >
+ TriaIterator<dim,DoFObjectAccessor<1, dim, DH> >
line (const unsigned int i) const;
/**
* Pointer to the <i>i</i>th quad
* bounding this Object.
*/
- TriaIterator<dim,DoFObjectAccessor<2, dim> >
+ TriaIterator<dim,DoFObjectAccessor<2, dim, DH> >
quad (const unsigned int i) const;
/**
* class returns a hex accessor without
* access to the DoF data.
*/
- TriaIterator<dim,DoFObjectAccessor<celldim, dim> > child (const unsigned int) const;
+ TriaIterator<dim,DoFObjectAccessor<celldim, dim, DH> > child (const unsigned int) const;
/**
* Distribute a local (cell
* Implement the copy operator needed
* for the iterator classes.
*/
- void copy_from (const DoFObjectAccessor<celldim, dim> &a);
+ void copy_from (const DoFObjectAccessor<celldim, dim, DH> &a);
protected:
/**
* Closure class.
* @ingroup dofs
*/
-template<int dim>
-class DoFObjectAccessor<0, dim> : public DoFAccessor<dim>,
- public DoFObjectAccessor_Inheritance<0,dim>::BaseClass
+template<int dim, template <int> class DH>
+class DoFObjectAccessor<0, dim, DH> : public DoFAccessor<dim, DH>,
+ public DoFObjectAccessor_Inheritance<0,dim>::BaseClass
{
public:
typedef void AccessorData;
* @ingroup dofs
* @author Wolfgang Bangerth, 1998
*/
-template <int dim>
-class DoFObjectAccessor<1, dim> : public DoFAccessor<dim>,
- public DoFObjectAccessor_Inheritance<1,dim>::BaseClass
+template <int dim, template <int> class DH>
+class DoFObjectAccessor<1, dim, DH> : public DoFAccessor<dim, DH>,
+ public DoFObjectAccessor_Inheritance<1,dim>::BaseClass
{
public:
/**
* class expects to get passed from the
* iterator classes.
*/
- typedef DoFHandler<dim> AccessorData;
+ typedef DH<dim> AccessorData;
/**
* Declare base class as a local typedef
void set_dof_values (const Vector<number> &local_values,
OutputVector &values) const;
+
+ /**
+ * Return the finite element that
+ * is used on the cell pointed to
+ * by this iterator. For non-hp
+ * DoF handlers, this is of
+ * course always the same
+ * element, independent of the
+ * cell we are presently on, but
+ * for hp DoF handlers, this may
+ * change from cell to cell.
+ */
+ const FiniteElement<dim> &
+ get_fe () const;
+
+ /**
+ * Returns the index inside the FECollection
+ * of the FiniteElement used for this cell.
+ */
+ unsigned int active_fe_index () const;
+
+ /**
+ * Sets the index of the FiniteElement used for
+ * this cell.
+ */
+ void set_active_fe_index (const unsigned int i);
+
/**
* Return the @p ith child as a DoF line
* iterator. This function is needed since
* class returns a line accessor without
* access to the DoF data.
*/
- TriaIterator<dim,DoFObjectAccessor<1,dim> > child (const unsigned int) const;
+ TriaIterator<dim,DoFObjectAccessor<1,dim,DH> > child (const unsigned int) const;
/**
* Distribute a local (cell based) vector
* Implement the copy operator needed
* for the iterator classes.
*/
- void copy_from (const DoFObjectAccessor<1,dim> &a);
+ void copy_from (const DoFObjectAccessor<1,dim,DH> &a);
protected:
/**
* Compare for equality.
*/
- bool operator == (const DoFObjectAccessor<1,dim> &) const;
+ bool operator == (const DoFObjectAccessor<1,dim,DH> &) const;
/**
* Compare for inequality.
*/
- bool operator != (const DoFObjectAccessor<1,dim> &) const;
+ bool operator != (const DoFObjectAccessor<1,dim,DH> &) const;
/**
*
* @ingroup dofs
*/
-template <int dim>
-class DoFObjectAccessor<2, dim> : public DoFAccessor<dim>,
- public DoFObjectAccessor_Inheritance<2,dim>::BaseClass
+template <int dim, template <int> class DH>
+class DoFObjectAccessor<2, dim, DH> : public DoFAccessor<dim, DH>,
+ public DoFObjectAccessor_Inheritance<2,dim>::BaseClass
{
public:
/**
* class expects to get passed from the
* iterator classes.
*/
- typedef DoFHandler<dim> AccessorData;
+ typedef DH<dim> AccessorData;
/**
* Declare base class as a local typedef
void set_dof_values (const Vector<number> &local_values,
OutputVector &values) const;
+
+ /**
+ * Return the finite element that
+ * is used on the cell pointed to
+ * by this iterator. For non-hp
+ * DoF handlers, this is of
+ * course always the same
+ * element, independent of the
+ * cell we are presently on, but
+ * for hp DoF handlers, this may
+ * change from cell to cell.
+ */
+ const FiniteElement<dim> &
+ get_fe () const;
+
+ /**
+ * Returns the index inside the FECollection
+ * of the FiniteElement used for this cell.
+ */
+ unsigned int active_fe_index () const;
+
+ /**
+ * Sets the index of the FiniteElement used for
+ * this cell.
+ */
+ void set_active_fe_index (const unsigned int i);
+
/**
* Return a pointer to the @p ith line
* bounding this @p Quad.
*/
- TriaIterator<dim,DoFObjectAccessor<1, dim> >
+ TriaIterator<dim,DoFObjectAccessor<1, dim, DH> >
line (const unsigned int i) const;
/**
* class returns a quad accessor without
* access to the DoF data.
*/
- TriaIterator<dim,DoFObjectAccessor<2, dim> >
+ TriaIterator<dim,DoFObjectAccessor<2, dim, DH> >
child (const unsigned int) const;
/**
* Implement the copy operator needed
* for the iterator classes.
*/
- void copy_from (const DoFObjectAccessor<2, dim> &a);
+ void copy_from (const DoFObjectAccessor<2, dim, DH> &a);
protected:
/**
* Compare for equality.
*/
- bool operator == (const DoFObjectAccessor<2,dim> &) const;
+ bool operator == (const DoFObjectAccessor<2,dim,DH> &) const;
/**
* Compare for inequality.
*/
- bool operator != (const DoFObjectAccessor<2,dim> &) const;
+ bool operator != (const DoFObjectAccessor<2,dim,DH> &) const;
/**
*
* @ingroup dofs
*/
-template <int dim>
-class DoFObjectAccessor<3, dim> : public DoFAccessor<dim>,
- public DoFObjectAccessor_Inheritance<3,dim>::BaseClass
+template <int dim, template <int> class DH>
+class DoFObjectAccessor<3, dim, DH> : public DoFAccessor<dim, DH>,
+ public DoFObjectAccessor_Inheritance<3,dim>::BaseClass
{
public:
/**
* class expects to get passed from the
* iterator classes.
*/
- typedef DoFHandler<dim> AccessorData;
+ typedef DH<dim> AccessorData;
/**
* Declare base class as a local typedef
void set_dof_values (const Vector<number> &local_values,
OutputVector &values) const;
+
+ /**
+ * Return the finite element that
+ * is used on the cell pointed to
+ * by this iterator. For non-hp
+ * DoF handlers, this is of
+ * course always the same
+ * element, independent of the
+ * cell we are presently on, but
+ * for hp DoF handlers, this may
+ * change from cell to cell.
+ */
+ const FiniteElement<dim> &
+ get_fe () const;
+
+ /**
+ * Returns the index inside the FECollection
+ * of the FiniteElement used for this cell.
+ */
+ unsigned int active_fe_index () const;
+
+ /**
+ * Sets the index of the FiniteElement used for
+ * this cell.
+ */
+ void set_active_fe_index (const unsigned int i);
+
/**
* Return a pointer to the @p ith line
* bounding this @p Hex.
*/
- TriaIterator<dim,DoFObjectAccessor<1, dim> >
+ TriaIterator<dim,DoFObjectAccessor<1, dim, DH> >
line (const unsigned int i) const;
/**
* Return a pointer to the @p ith quad
* bounding this @p Hex.
*/
- TriaIterator<dim,DoFObjectAccessor<2, dim> >
+ TriaIterator<dim,DoFObjectAccessor<2, dim, DH> >
quad (const unsigned int i) const;
/**
* class returns a hex accessor without
* access to the DoF data.
*/
- TriaIterator<dim,DoFObjectAccessor<3, dim> > child (const unsigned int) const;
+ TriaIterator<dim,DoFObjectAccessor<3, dim, DH> > child (const unsigned int) const;
/**
* Distribute a local (cell
* Implement the copy operator needed
* for the iterator classes.
*/
- void copy_from (const DoFObjectAccessor<3, dim> &a);
+ void copy_from (const DoFObjectAccessor<3, dim, DH> &a);
protected:
/**
* Compare for equality.
*/
- bool operator == (const DoFObjectAccessor<3,dim> &) const;
+ bool operator == (const DoFObjectAccessor<3,dim,DH> &) const;
/**
* Compare for inequality.
*/
- bool operator != (const DoFObjectAccessor<3,dim> &) const;
+ bool operator != (const DoFObjectAccessor<3,dim,DH> &) const;
/**
* @ingroup dofs
* @author Wolfgang Bangerth, 1998
*/
-template <int dim>
-class DoFCellAccessor : public DoFObjectAccessor<dim, dim>
+template <int dim, template <int> class DH>
+class DoFCellAccessor : public DoFObjectAccessor<dim, dim, DH>
{
public:
/**
* get passed from the iterator
* classes.
*/
- typedef typename DoFObjectAccessor<dim, dim>::AccessorData AccessorData;
+ typedef typename DoFObjectAccessor<dim, dim, DH>::AccessorData AccessorData;
/**
* Constructor
* without access to the DoF
* data.
*/
- TriaIterator<dim,DoFCellAccessor<dim> >
+ TriaIterator<dim,DoFCellAccessor<dim, DH> >
neighbor (const unsigned int) const;
/**
* without access to the DoF
* data.
*/
- TriaIterator<dim,DoFCellAccessor<dim> >
+ TriaIterator<dim,DoFCellAccessor<dim, DH> >
child (const unsigned int) const;
/**
* Return an iterator to the @p ith face
* of this cell.
*
- * This function is not implemented in 1D,
- * and maps to DoFObjectAccessor<2, dim>::line in 2D.
+ * This function is not implemented in
+ * 1D, and maps to DoFObjectAccessor<2,
+ * dim>::line in 2D.
*/
- TriaIterator<dim, DoFObjectAccessor<dim-1, dim> >
+ TriaIterator<dim, DoFObjectAccessor<dim-1, dim, DH> >
face (const unsigned int i) const;
- /**
+ /**
* Return the result of the
* @p neighbor_child_on_subface
* function of the base class,
* access to the triangulation
* data).
*/
- TriaIterator<dim,DoFCellAccessor<dim> >
+ TriaIterator<dim,DoFCellAccessor<dim,DH> >
neighbor_child_on_subface (const unsigned int face_no,
const unsigned int subface_no) const;
* child alone, i.e. it should
* be possible to compute the
* restriction by writing values
- * obtained from each child
+ * obtained from each child
* directly into the output
* vector, without, for example,
* computing an average over all
/* -------------- declaration of explicit specializations ------------- */
-template <> TriaIterator<1, DoFObjectAccessor<0,1> > DoFCellAccessor<1>::face (const unsigned int) const;
-template <> TriaIterator<2, DoFObjectAccessor<1,2> > DoFCellAccessor<2>::face (const unsigned int i) const;
-template <> TriaIterator<3, DoFObjectAccessor<2,3> > DoFCellAccessor<3>::face (const unsigned int i) const;
+template <>
+TriaIterator<1, DoFObjectAccessor<0,1, DoFHandler> >
+DoFCellAccessor<1, DoFHandler>::face (const unsigned int) const;
+template <>
+TriaIterator<2, DoFObjectAccessor<1,2, DoFHandler> >
+DoFCellAccessor<2, DoFHandler>::face (const unsigned int i) const;
+template <>
+TriaIterator<3, DoFObjectAccessor<2,3, DoFHandler> >
+DoFCellAccessor<3, DoFHandler>::face (const unsigned int i) const;
+
+template <>
+const FiniteElement<1> &
+DoFObjectAccessor<1,1,hpDoFHandler>::get_fe () const;
+template <>
+const FiniteElement<2> &
+DoFObjectAccessor<1,2,hpDoFHandler>::get_fe () const;
+template <>
+const FiniteElement<3> &
+DoFObjectAccessor<1,3,hpDoFHandler>::get_fe () const;
+template <>
+const FiniteElement<2> &
+DoFObjectAccessor<2,2,hpDoFHandler>::get_fe () const;
+template <>
+const FiniteElement<3> &
+DoFObjectAccessor<2,3,hpDoFHandler>::get_fe () const;
+template <>
+const FiniteElement<3> &
+DoFObjectAccessor<3,3,hpDoFHandler>::get_fe () const;
+
+template <>
+unsigned int
+DoFObjectAccessor<1,1,hpDoFHandler>::active_fe_index () const;
+template <>
+unsigned int
+DoFObjectAccessor<1,2,hpDoFHandler>::active_fe_index () const;
+template <>
+unsigned int
+DoFObjectAccessor<1,3,hpDoFHandler>::active_fe_index () const;
+template <>
+unsigned int
+DoFObjectAccessor<2,2,hpDoFHandler>::active_fe_index () const;
+template <>
+unsigned int
+DoFObjectAccessor<2,3,hpDoFHandler>::active_fe_index () const;
+template <>
+unsigned int
+DoFObjectAccessor<3,3,hpDoFHandler>::active_fe_index () const;
+
+template <>
+void
+DoFObjectAccessor<1,1,hpDoFHandler>::set_active_fe_index (const unsigned int i);
+template <>
+void
+DoFObjectAccessor<1,2,hpDoFHandler>::set_active_fe_index (const unsigned int i);
+template <>
+void
+DoFObjectAccessor<1,3,hpDoFHandler>::set_active_fe_index (const unsigned int i);
+template <>
+void
+DoFObjectAccessor<2,2,hpDoFHandler>::set_active_fe_index (const unsigned int i);
+template <>
+void
+DoFObjectAccessor<2,3,hpDoFHandler>::set_active_fe_index (const unsigned int i);
+template <>
+void
+DoFObjectAccessor<3,3,hpDoFHandler>::set_active_fe_index (const unsigned int i);
// include more templates
#include <base/config.h>
#include <dofs/dof_accessor.h>
#include <dofs/dof_handler.h>
+#include <dofs/hp_dof_handler.h>
#include <dofs/dof_levels.h>
+#include <dofs/hp_dof_levels.h>
#include <grid/tria_iterator.h>
#include <grid/tria_iterator.templates.h>
/*------------------------- Functions: DoFAccessor ---------------------------*/
-template <int dim>
-DoFAccessor<dim>::DoFAccessor ()
+template <int dim, template <int> class DH>
+DoFAccessor<dim, DH>::DoFAccessor ()
:
dof_handler(0)
{
-template <int dim>
+template <int dim, template <int> class DH>
inline
-DoFAccessor<dim>::DoFAccessor (const DoFHandler<dim> *dof_handler) :
- dof_handler(const_cast<DoFHandler<dim>*>(dof_handler))
+DoFAccessor<dim, DH>::DoFAccessor (const DH<dim> *dof_handler) :
+ dof_handler(const_cast<DH<dim>*>(dof_handler))
{}
-template <int dim>
+template <int dim, template <int> class DH>
void
-DoFAccessor<dim>::set_dof_handler (DoFHandler<dim> *dh)
+DoFAccessor<dim, DH>::set_dof_handler (DH<dim> *dh)
{
Assert (dh != 0, ExcInvalidObject());
dof_handler = dh;
-template <int dim>
+template <int dim, template <int> class DH>
inline
-const DoFHandler<dim> &
-DoFAccessor<dim>::get_dof_handler () const
+const DH<dim> &
+DoFAccessor<dim, DH>::get_dof_handler () const
{
- return *dof_handler;
+ return *this->dof_handler;
}
-
-template <int dim>
-inline
-const FiniteElement<dim> &
-DoFAccessor<dim>::get_fe () const
-{
- return *dof_handler->selected_fe;
-}
-
-
-
-template <int dim>
+template <int dim, template <int> class DH>
inline
-DoFAccessor<dim> &
-DoFAccessor<dim>::operator = (const DoFAccessor<dim> &da)
+DoFAccessor<dim, DH> &
+DoFAccessor<dim, DH>::operator = (const DoFAccessor<dim, DH> &da)
{
this->set_dof_handler (da.dof_handler);
return *this;
-template <int dim>
+template <int dim, template <int> class DH>
inline
bool
-DoFAccessor<dim>::operator == (const DoFAccessor<dim> &a) const
+DoFAccessor<dim, DH>::operator == (const DoFAccessor<dim, DH> &a) const
{
Assert (dof_handler == a.dof_handler, ExcCantCompareIterators());
-template <int dim>
+template <int dim, template <int> class DH>
inline
bool
-DoFAccessor<dim>::operator != (const DoFAccessor<dim> &a) const
+DoFAccessor<dim, DH>::operator != (const DoFAccessor<dim, DH> &a) const
{
Assert (dof_handler == a.dof_handler, ExcCantCompareIterators());
/*------------------------- Functions: DoFObjectAccessor<1,dim> -----------------------*/
-
-template <int dim>
+template <int dim, template <int> class DH>
inline
-DoFObjectAccessor<1,dim>::
+DoFObjectAccessor<1,dim,DH>::
DoFObjectAccessor (const Triangulation<dim> *tria,
const int level,
const int index,
const AccessorData *local_data)
:
- DoFAccessor<dim> (local_data),
+ DoFAccessor<dim,DH> (local_data),
DoFObjectAccessor_Inheritance<1,dim>::BaseClass (tria,
level,
index)
-template <int dim>
+template <int dim, template <int> class DH>
inline
unsigned int
-DoFObjectAccessor<1,dim>::dof_index (const unsigned int i) const
+DoFObjectAccessor<1,dim,DH>::dof_index (const unsigned int i) const
{
// since the exception classes are
// from a template dependent base
// non-template dependent name and
// use that to specify the
// qualified exception names
- typedef DoFAccessor<dim> BaseClass;
+ typedef DoFAccessor<dim, DH> BaseClass;
Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject());
// make sure a FE has been selected
}
-
-template <int dim>
+template <int dim, template <int> class DH>
inline
unsigned int
-DoFObjectAccessor<1,dim>::vertex_dof_index (const unsigned int vertex,
- const unsigned int i) const
+DoFObjectAccessor<1,dim,DH>::vertex_dof_index (const unsigned int vertex,
+ const unsigned int i) const
{
// since the exception classes are
// from a template dependent base
// non-template dependent name and
// use that to specify the
// qualified exception names
- typedef DoFAccessor<dim> BaseClass;
+ typedef DoFAccessor<dim, DH> BaseClass;
Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject());
Assert (&this->get_fe() != 0, typename BaseClass::ExcInvalidObject());
}
-
-template <int dim>
+template <int dim, template <int> class DH>
inline
void
-DoFObjectAccessor<1,dim>::get_dof_indices (std::vector<unsigned int> &dof_indices) const
+DoFObjectAccessor<1,dim,DH>::get_dof_indices (std::vector<unsigned int> &dof_indices) const
{
// since the exception classes are
// from a template dependent base
// non-template dependent name and
// use that to specify the
// qualified exception names
- typedef DoFAccessor<dim> BaseClass;
+ typedef DoFAccessor<dim, DH> BaseClass;
Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject());
Assert (&this->get_fe() != 0, typename BaseClass::ExcInvalidObject());
- Assert (dof_indices.size() == (2*this->dof_handler->get_fe().dofs_per_vertex +
- this->dof_handler->get_fe().dofs_per_line),
+ Assert (dof_indices.size() == (2*this->get_fe().dofs_per_vertex +
+ this->get_fe().dofs_per_line),
typename BaseClass::ExcVectorDoesNotMatch());
// this function really only makes
// not allocated for this
// non-active thing
Assert (!this->has_children() ||
- (this->dof_handler->get_fe().dofs_per_cell ==
- 2*this->dof_handler->get_fe().dofs_per_vertex),
- typename DoFAccessor<dim>::ExcNotActive());
+ (this->get_fe().dofs_per_cell ==
+ 2*this->get_fe().dofs_per_vertex),
+ typename BaseClass::ExcNotActive());
- const unsigned int dofs_per_vertex = this->dof_handler->get_fe().dofs_per_vertex,
- dofs_per_line = this->dof_handler->get_fe().dofs_per_line;
+ const unsigned int dofs_per_vertex = this->get_fe().dofs_per_vertex,
+ dofs_per_line = this->get_fe().dofs_per_line;
std::vector<unsigned int>::iterator next = dof_indices.begin();
for (unsigned int vertex=0; vertex<2; ++vertex)
for (unsigned int d=0; d<dofs_per_vertex; ++d)
-template <int dim>
+template <int dim, template <int> class DH>
inline
-TriaIterator<dim,DoFObjectAccessor<1,dim> >
-DoFObjectAccessor<1,dim>::child (const unsigned int i) const
+TriaIterator<dim,DoFObjectAccessor<1,dim,DH> >
+DoFObjectAccessor<1,dim,DH>::child (const unsigned int i) const
{
- TriaIterator<dim,DoFObjectAccessor<1,dim> > q (this->tria,
- this->present_level+1,
- this->child_index (i),
- this->dof_handler);
+ TriaIterator<dim,DoFObjectAccessor<1,dim,DH> > q (this->tria,
+ this->present_level+1,
+ this->child_index (i),
+ this->dof_handler);
#ifdef DEBUG
if (q.state() != IteratorState::past_the_end)
-template <int dim>
+template <int dim, template <int> class DH>
+inline
+const FiniteElement<dim> &
+DoFObjectAccessor<1,dim,DH>::get_fe () const
+{
+ return *this->dof_handler->selected_fe;
+}
+
+
+template <int dim, template <int> class DH>
+inline
+unsigned int
+DoFObjectAccessor<1,dim,DH>::active_fe_index () const
+{
+ return 0;
+}
+
+
+template <int dim, template <int> class DH>
+inline
+void
+DoFObjectAccessor<1,dim,DH>::set_active_fe_index (const unsigned int i)
+{
+ typedef DoFAccessor<dim, DoFHandler> BaseClass;
+ Assert (i == 0, typename BaseClass::ExcInvalidObject());
+}
+
+
+template <int dim, template <int> class DH>
template <typename number, typename OutputVector>
inline
void
-DoFObjectAccessor<1, dim>::
+DoFObjectAccessor<1, dim, DH>::
distribute_local_to_global (const Vector<number> &local_source,
OutputVector &global_destination) const
{
// non-template dependent name and
// use that to specify the
// qualified exception names
- typedef DoFAccessor<dim> BaseClass;
+ typedef DoFAccessor<dim,DH> BaseClass;
Assert (this->dof_handler != 0,
typename BaseClass::ExcInvalidObject());
-template <int dim>
+template <int dim, template <int> class DH>
template <typename number, typename OutputMatrix>
inline
void
-DoFObjectAccessor<1, dim>::
+DoFObjectAccessor<1, dim, DH>::
distribute_local_to_global (const FullMatrix<number> &local_source,
OutputMatrix &global_destination) const
{
// non-template dependent name and
// use that to specify the
// qualified exception names
- typedef DoFAccessor<dim> BaseClass;
+ typedef DoFAccessor<dim,DH> BaseClass;
Assert (this->dof_handler != 0,
typename BaseClass::ExcInvalidObject());
-template <int dim>
+template <int dim, template <int> class DH>
inline
void
-DoFObjectAccessor<1,dim>::copy_from (const DoFObjectAccessor<1,dim> &a)
+DoFObjectAccessor<1,dim,DH>::copy_from (const DoFObjectAccessor<1,dim,DH> &a)
{
BaseClass::copy_from (a);
this->set_dof_handler (a.dof_handler);
-template <int dim>
+template <int dim, template <int> class DH>
inline
bool
-DoFObjectAccessor<1,dim>::operator == (const DoFObjectAccessor<1,dim> &a) const
+DoFObjectAccessor<1,dim,DH>::operator == (const DoFObjectAccessor<1,dim,DH> &a) const
{
return (TriaObjectAccessor<1,dim>::operator == (a)
&&
- DoFAccessor<dim>::operator == (a));
+ DoFAccessor<dim,DH>::operator == (a));
}
-template <int dim>
+template <int dim, template <int> class DH>
inline
bool
-DoFObjectAccessor<1,dim>::operator != (const DoFObjectAccessor<1,dim> &a) const
+DoFObjectAccessor<1,dim,DH>::operator != (const DoFObjectAccessor<1,dim,DH> &a) const
{
return (TriaObjectAccessor<1,dim>::operator != (a)
||
- DoFAccessor<dim>::operator != (a));
+ DoFAccessor<dim,DH>::operator != (a));
}
/*------------------------- Functions: DoFObjectAccessor<2,dim> -----------------------*/
-template <int dim>
-inline
-DoFObjectAccessor<2,dim>::
+template <int dim, template <int> class DH>
+DoFObjectAccessor<2,dim,DH>::
DoFObjectAccessor (const Triangulation<dim> *tria,
const int level,
const int index,
const AccessorData *local_data)
:
- DoFAccessor<dim> (local_data),
+ DoFAccessor<dim,DH> (local_data),
DoFObjectAccessor_Inheritance<2,dim>::BaseClass (tria,
level,
index)
-template <int dim>
+template <int dim, template <int> class DH>
inline
-unsigned int DoFObjectAccessor<2,dim>::dof_index (const unsigned int i) const
+unsigned int
+DoFObjectAccessor<2,dim,DH>::dof_index (const unsigned int i) const
{
+ typedef DoFAccessor<dim,DH> BaseClass;
+
Assert (this->dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
// make sure a FE has been selected
// and enough room was reserved
Assert (&this->get_fe() != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (i<this->get_fe().dofs_per_quad,
ExcIndexRange (i, 0, this->get_fe().dofs_per_quad));
}
-template <int dim>
+template <int dim, template <int> class DH>
inline
unsigned int
-DoFObjectAccessor<2,dim>::vertex_dof_index (const unsigned int vertex,
- const unsigned int i) const
+DoFObjectAccessor<2,dim,DH>::vertex_dof_index (const unsigned int vertex,
+ const unsigned int i) const
{
+ typedef DoFAccessor<dim, DH> BaseClass;
+
Assert (this->dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (&this->get_fe() != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (vertex<4, ExcIndexRange (i,0,4));
Assert (i<this->get_fe().dofs_per_vertex,
ExcIndexRange (i, 0, this->get_fe().dofs_per_vertex));
-template <int dim>
+template <int dim, template <int> class DH>
inline
void
-DoFObjectAccessor<2,dim>::get_dof_indices (std::vector<unsigned int> &dof_indices) const
+DoFObjectAccessor<2,dim,DH>::get_dof_indices (std::vector<unsigned int> &dof_indices) const
{
+ typedef DoFAccessor<dim, DH> BaseClass;
+
Assert (this->dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (&this->get_fe() != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
- Assert (dof_indices.size() == (4*this->dof_handler->get_fe().dofs_per_vertex +
- 4*this->dof_handler->get_fe().dofs_per_line +
- this->dof_handler->get_fe().dofs_per_quad),
- typename DoFAccessor<dim>::ExcVectorDoesNotMatch());
+ typename BaseClass::ExcInvalidObject());
+ Assert (dof_indices.size() == (4*this->get_fe().dofs_per_vertex +
+ 4*this->get_fe().dofs_per_line +
+ this->get_fe().dofs_per_quad),
+ typename BaseClass::ExcVectorDoesNotMatch());
// this function really only makes
// sense on non-active objects if
// not allocated for this
// non-active thing
Assert (!this->has_children() ||
- (this->dof_handler->get_fe().dofs_per_cell ==
- 4*this->dof_handler->get_fe().dofs_per_vertex),
- typename DoFAccessor<dim>::ExcNotActive());
+ (this->get_fe().dofs_per_cell ==
+ 4*this->get_fe().dofs_per_vertex),
+ typename BaseClass::ExcNotActive());
- const unsigned int dofs_per_vertex = this->dof_handler->get_fe().dofs_per_vertex,
- dofs_per_line = this->dof_handler->get_fe().dofs_per_line,
- dofs_per_quad = this->dof_handler->get_fe().dofs_per_quad;
+ const unsigned int dofs_per_vertex = this->get_fe().dofs_per_vertex,
+ dofs_per_line = this->get_fe().dofs_per_line,
+ dofs_per_quad = this->get_fe().dofs_per_quad;
std::vector<unsigned int>::iterator next = dof_indices.begin();
for (unsigned int vertex=0; vertex<4; ++vertex)
for (unsigned int d=0; d<dofs_per_vertex; ++d)
}
-
-template <int dim>
+template <int dim, template <int> class DH>
inline
-TriaIterator<dim,DoFObjectAccessor<1,dim> >
-DoFObjectAccessor<2,dim>::line (const unsigned int i) const
+TriaIterator<dim,DoFObjectAccessor<1,dim,DH> >
+DoFObjectAccessor<2,dim,DH>::line (const unsigned int i) const
{
Assert (i<4, ExcIndexRange (i, 0, 4));
- return TriaIterator<dim,DoFObjectAccessor<1,dim> >
+ return TriaIterator<dim,DoFObjectAccessor<1,dim,DH> >
(
this->tria,
this->present_level,
}
-
-template <int dim>
+template <int dim, template <int> class DH>
inline
-TriaIterator<dim,DoFObjectAccessor<2,dim> >
-DoFObjectAccessor<2,dim>::child (const unsigned int i) const
+TriaIterator<dim,DoFObjectAccessor<2,dim,DH> >
+DoFObjectAccessor<2,dim,DH>::child (const unsigned int i) const
{
- TriaIterator<dim,DoFObjectAccessor<2,dim> > q (this->tria,
+ TriaIterator<dim,DoFObjectAccessor<2,dim,DH> > q (this->tria,
this->present_level+1,
this->child_index (i),
this->dof_handler);
}
+template <int dim, template <int> class DH>
+inline
+const FiniteElement<dim> &
+DoFObjectAccessor<2,dim,DH>::get_fe () const
+{
+ return *this->dof_handler->selected_fe;
+}
+
+
+template <int dim, template <int> class DH>
+inline
+unsigned int
+DoFObjectAccessor<2,dim,DH>::active_fe_index () const
+{
+ return 0;
+}
+
+
+template <int dim, template <int> class DH>
+inline
+void
+DoFObjectAccessor<2,dim,DH>::set_active_fe_index (const unsigned int i)
+{
+ typedef DoFAccessor<dim, DH> BaseClass;
+ Assert (i == 0, typename BaseClass::ExcInvalidObject());
+}
+
+
-template <int dim>
+template <int dim, template <int> class DH>
template <typename number, typename OutputVector>
inline
void
-DoFObjectAccessor<2, dim>::
+DoFObjectAccessor<2, dim, DH>::
distribute_local_to_global (const Vector<number> &local_source,
OutputVector &global_destination) const
{
// non-template dependent name and
// use that to specify the
// qualified exception names
- typedef DoFAccessor<dim> BaseClass;
+ typedef DoFAccessor<dim,DH> BaseClass;
Assert (this->dof_handler != 0,
typename BaseClass::ExcInvalidObject());
-template <int dim>
+template <int dim, template <int> class DH>
template <typename number, typename OutputMatrix>
inline
void
-DoFObjectAccessor<2, dim>::
+DoFObjectAccessor<2, dim, DH>::
distribute_local_to_global (const FullMatrix<number> &local_source,
OutputMatrix &global_destination) const
{
// non-template dependent name and
// use that to specify the
// qualified exception names
- typedef DoFAccessor<dim> BaseClass;
+ typedef DoFAccessor<dim,DH> BaseClass;
Assert (this->dof_handler != 0,
typename BaseClass::ExcInvalidObject());
-template <int dim>
+template <int dim, template <int> class DH>
inline
void
-DoFObjectAccessor<2,dim>::copy_from (const DoFObjectAccessor<2,dim> &a)
+DoFObjectAccessor<2,dim,DH>::copy_from (const DoFObjectAccessor<2,dim,DH> &a)
{
BaseClass::copy_from (a);
this->set_dof_handler (a.dof_handler);
-template <int dim>
+template <int dim, template <int> class DH>
inline
bool
-DoFObjectAccessor<2,dim>::operator == (const DoFObjectAccessor<2,dim> &a) const
+DoFObjectAccessor<2,dim,DH>::operator == (const DoFObjectAccessor<2,dim,DH> &a) const
{
return (TriaObjectAccessor<2,dim>::operator == (a)
&&
- DoFAccessor<dim>::operator == (a));
+ DoFAccessor<dim,DH>::operator == (a));
}
-template <int dim>
+template <int dim, template <int> class DH>
inline
bool
-DoFObjectAccessor<2,dim>::operator != (const DoFObjectAccessor<2,dim> &a) const
+DoFObjectAccessor<2,dim,DH>::operator != (const DoFObjectAccessor<2,dim,DH> &a) const
{
return (TriaObjectAccessor<2,dim>::operator != (a)
||
- DoFAccessor<dim>::operator != (a));
+ DoFAccessor<dim,DH>::operator != (a));
}
/*------------------------- Functions: DoFObjectAccessor<3,dim> -----------------------*/
-
-template <int dim>
+template <int dim, template <int> class DH>
inline
-DoFObjectAccessor<3,dim>::
+DoFObjectAccessor<3,dim,DH>::
DoFObjectAccessor (const Triangulation<dim> *tria,
const int level,
const int index,
const AccessorData *local_data)
:
- DoFAccessor<dim> (local_data),
+ DoFAccessor<dim,DH> (local_data),
DoFObjectAccessor_Inheritance<3,dim>::BaseClass (tria,
level,
index)
-template <int dim>
+template <int dim, template <int> class DH>
inline
unsigned int
-DoFObjectAccessor<3,dim>::dof_index (const unsigned int i) const
+DoFObjectAccessor<3,dim,DH>::dof_index (const unsigned int i) const
{
+ typedef DoFAccessor<dim, DH> BaseClass;
+
Assert (this->dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
// make sure a FE has been selected
// and enough room was reserved
Assert (&this->get_fe() != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (i<this->get_fe().dofs_per_hex,
ExcIndexRange (i, 0, this->get_fe().dofs_per_hex));
}
-
-template <int dim>
+template <int dim, template <int> class DH>
inline
unsigned int
-DoFObjectAccessor<3,dim>::vertex_dof_index (const unsigned int vertex,
- const unsigned int i) const
+DoFObjectAccessor<3,dim,DH>::vertex_dof_index (const unsigned int vertex,
+ const unsigned int i) const
{
+ typedef DoFAccessor<dim, DH> BaseClass;
+
Assert (this->dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (&this->get_fe() != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (vertex<8, ExcIndexRange (i,0,8));
Assert (i<this->get_fe().dofs_per_vertex,
ExcIndexRange (i, 0, this->get_fe().dofs_per_vertex));
}
-
-template <int dim>
+template <int dim, template <int> class DH>
inline
void
-DoFObjectAccessor<3,dim>::get_dof_indices (std::vector<unsigned int> &dof_indices) const
+DoFObjectAccessor<3,dim,DH>::get_dof_indices (std::vector<unsigned int> &dof_indices) const
{
+ typedef DoFAccessor<dim, DH> BaseClass;
+
Assert (this->dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (&this->get_fe() != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
- Assert (dof_indices.size() == (8*this->dof_handler->get_fe().dofs_per_vertex +
- 12*this->dof_handler->get_fe().dofs_per_line +
- 6*this->dof_handler->get_fe().dofs_per_quad +
- this->dof_handler->get_fe().dofs_per_hex),
- typename DoFAccessor<dim>::ExcVectorDoesNotMatch());
+ typename BaseClass::ExcInvalidObject());
+ Assert (dof_indices.size() == (8*this->get_fe().dofs_per_vertex +
+ 12*this->get_fe().dofs_per_line +
+ 6*this->get_fe().dofs_per_quad +
+ this->get_fe().dofs_per_hex),
+ typename BaseClass::ExcVectorDoesNotMatch());
// this function really only makes
// sense on non-active objects if
// not allocated for this
// non-active thing
Assert (!this->has_children() ||
- (this->dof_handler->get_fe().dofs_per_cell ==
- 8*this->dof_handler->get_fe().dofs_per_vertex),
- typename DoFAccessor<dim>::ExcNotActive());
+ (this->get_fe().dofs_per_cell ==
+ 8*this->get_fe().dofs_per_vertex),
+ typename BaseClass::ExcNotActive());
- const unsigned int dofs_per_vertex = this->dof_handler->get_fe().dofs_per_vertex,
- dofs_per_line = this->dof_handler->get_fe().dofs_per_line,
- dofs_per_quad = this->dof_handler->get_fe().dofs_per_quad,
- dofs_per_hex = this->dof_handler->get_fe().dofs_per_hex;
+ const unsigned int dofs_per_vertex = this->get_fe().dofs_per_vertex,
+ dofs_per_line = this->get_fe().dofs_per_line,
+ dofs_per_quad = this->get_fe().dofs_per_quad,
+ dofs_per_hex = this->get_fe().dofs_per_hex;
std::vector<unsigned int>::iterator next = dof_indices.begin();
for (unsigned int vertex=0; vertex<8; ++vertex)
for (unsigned int d=0; d<dofs_per_vertex; ++d)
-template <int dim>
+template <int dim, template <int> class DH>
inline
-TriaIterator<dim,DoFObjectAccessor<1,dim> >
-DoFObjectAccessor<3,dim>::line (const unsigned int i) const
+TriaIterator<dim,DoFObjectAccessor<1,dim,DH> >
+DoFObjectAccessor<3,dim,DH>::line (const unsigned int i) const
{
TriaIterator<dim,TriaObjectAccessor<1,dim> > l = BaseClass::line(i);
- return TriaIterator<dim,DoFObjectAccessor<1,dim> >
+ return TriaIterator<dim,DoFObjectAccessor<1,dim,DH> >
(
this->tria,
this->present_level,
}
-
-template <int dim>
+template <int dim, template <int> class DH>
inline
-TriaIterator<dim,DoFObjectAccessor<2,dim> >
-DoFObjectAccessor<3,dim>::quad (const unsigned int i) const
+TriaIterator<dim,DoFObjectAccessor<2,dim,DH> >
+DoFObjectAccessor<3,dim,DH>::quad (const unsigned int i) const
{
Assert (i<6, ExcIndexRange (i, 0, 6));
- return TriaIterator<dim,DoFObjectAccessor<2,dim> >
+ return TriaIterator<dim,DoFObjectAccessor<2,dim,DH> >
(
this->tria,
this->present_level,
}
-
-template <int dim>
+template <int dim, template <int> class DH>
inline
-TriaIterator<dim,DoFObjectAccessor<3,dim> >
-DoFObjectAccessor<3,dim>::child (const unsigned int i) const
+TriaIterator<dim,DoFObjectAccessor<3,dim,DH> >
+DoFObjectAccessor<3,dim,DH>::child (const unsigned int i) const
{
- TriaIterator<dim,DoFObjectAccessor<3,dim> > q (this->tria,
- this->present_level+1,
- this->child_index (i),
- this->dof_handler);
+ TriaIterator<dim,DoFObjectAccessor<3,dim,DH> > q (this->tria,
+ this->present_level+1,
+ this->child_index (i),
+ this->dof_handler);
#ifdef DEBUG
if (q.state() != IteratorState::past_the_end)
}
+template <int dim, template <int> class DH>
+inline
+const FiniteElement<dim> &
+DoFObjectAccessor<3,dim,DH>::get_fe () const
+{
+ return *this->dof_handler->selected_fe;
+}
+
+
+template <int dim, template <int> class DH>
+inline
+unsigned int
+DoFObjectAccessor<3,dim,DH>::active_fe_index () const
+{
+ return 0;
+}
+
+
+template <int dim, template <int> class DH>
+inline
+void
+DoFObjectAccessor<3,dim,DH>::set_active_fe_index (const unsigned int i)
+{
+ typedef DoFAccessor<dim, DH> BaseClass;
+ Assert (i == 0, typename BaseClass::ExcInvalidObject());
+}
+
-template <int dim>
+template <int dim, template <int> class DH>
template <typename number, typename OutputVector>
inline
void
-DoFObjectAccessor<3, dim>::
+DoFObjectAccessor<3, dim, DH>::
distribute_local_to_global (const Vector<number> &local_source,
OutputVector &global_destination) const
{
// non-template dependent name and
// use that to specify the
// qualified exception names
- typedef DoFAccessor<dim> BaseClass;
+ typedef DoFAccessor<dim,DH> BaseClass;
Assert (this->dof_handler != 0,
typename BaseClass::ExcInvalidObject());
-template <int dim>
+template <int dim, template <int> class DH>
template <typename number, typename OutputMatrix>
inline
void
-DoFObjectAccessor<3, dim>::
+DoFObjectAccessor<3, dim, DH>::
distribute_local_to_global (const FullMatrix<number> &local_source,
OutputMatrix &global_destination) const
{
// non-template dependent name and
// use that to specify the
// qualified exception names
- typedef DoFAccessor<dim> BaseClass;
+ typedef DoFAccessor<dim,DH> BaseClass;
Assert (this->dof_handler != 0,
typename BaseClass::ExcInvalidObject());
-template <int dim>
-void DoFObjectAccessor<3,dim>::copy_from (const DoFObjectAccessor<3,dim> &a)
+template <int dim, template <int> class DH>
+void DoFObjectAccessor<3,dim,DH>::copy_from (const DoFObjectAccessor<3,dim,DH> &a)
{
BaseClass::copy_from (a);
this->set_dof_handler (a.dof_handler);
-template <int dim>
+template <int dim, template <int> class DH>
inline
bool
-DoFObjectAccessor<3,dim>::operator == (const DoFObjectAccessor<3,dim> &a) const
+DoFObjectAccessor<3,dim,DH>::operator == (const DoFObjectAccessor<3,dim,DH> &a) const
{
return (TriaObjectAccessor<3,dim>::operator == (a)
&&
- DoFAccessor<dim>::operator == (a));
+ DoFAccessor<dim,DH>::operator == (a));
}
-template <int dim>
+template <int dim, template <int> class DH>
inline
bool
-DoFObjectAccessor<3,dim>::operator != (const DoFObjectAccessor<3,dim> &a) const
+DoFObjectAccessor<3,dim,DH>::operator != (const DoFObjectAccessor<3,dim,DH> &a) const
{
return (TriaObjectAccessor<3,dim>::operator != (a)
||
- DoFAccessor<dim>::operator != (a));
+ DoFAccessor<dim,DH>::operator != (a));
}
/*------------------------- Functions: DoFCellAccessor -----------------------*/
-
-template <int dim>
+template <int dim, template <int> class DH>
inline
-DoFCellAccessor<dim>::
+DoFCellAccessor<dim,DH>::
DoFCellAccessor (const Triangulation<dim> *tria,
const int level,
const int index,
const AccessorData *local_data)
:
- DoFObjectAccessor<dim, dim> (tria,level,index,local_data)
+ DoFObjectAccessor<dim, dim, DH> (tria,level,index,local_data)
{}
-template <int dim>
+template <int dim, template <int> class DH>
inline
-TriaIterator<dim,DoFCellAccessor<dim> >
-DoFCellAccessor<dim>::neighbor (const unsigned int i) const
+TriaIterator<dim,DoFCellAccessor<dim,DH> >
+DoFCellAccessor<dim,DH>::neighbor (const unsigned int i) const
{
- TriaIterator<dim,DoFCellAccessor<dim> > q (this->tria,
- this->neighbor_level (i),
- this->neighbor_index (i),
- this->dof_handler);
+ TriaIterator<dim,DoFCellAccessor<dim,DH> > q (this->tria,
+ this->neighbor_level (i),
+ this->neighbor_index (i),
+ this->dof_handler);
#ifdef DEBUG
if (q.state() != IteratorState::past_the_end)
}
-template <int dim>
+template <int dim, template <int> class DH>
inline
-TriaIterator<dim,DoFCellAccessor<dim> >
-DoFCellAccessor<dim>::child (const unsigned int i) const
+TriaIterator<dim,DoFCellAccessor<dim,DH> >
+DoFCellAccessor<dim,DH>::child (const unsigned int i) const
{
- TriaIterator<dim,DoFCellAccessor<dim> > q (this->tria,
- this->present_level+1,
- this->child_index (i),
- this->dof_handler);
+ TriaIterator<dim,DoFCellAccessor<dim,DH> > q (this->tria,
+ this->present_level+1,
+ this->child_index (i),
+ this->dof_handler);
#ifdef DEBUG
if (q.state() != IteratorState::past_the_end)
}
+/*--------------- Functions: DoFObjectAccessor<1,dim,hpDoFHandler> -----------*/
+
+template <>
+inline
+unsigned int
+DoFObjectAccessor<1,1,hpDoFHandler>::dof_index (const unsigned int i) const
+{
+ // 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<1, hpDoFHandler> BaseClass;
+
+ Assert (this->dof_handler != 0, BaseClass::ExcInvalidObject());
+ // make sure a FE has been selected
+ // and enough room was reserved
+ Assert (&this->get_fe() != 0, BaseClass::ExcInvalidObject());
+ Assert (i<this->get_fe().dofs_per_line,
+ ExcIndexRange (i, 0, this->get_fe().dofs_per_line));
+
+ const unsigned int offset = this->dof_handler->levels[this->present_level]
+ ->dof_line_index_offset[this->present_index];
+ return this->dof_handler->levels[this->present_level]
+ ->line_dofs[offset+i];
+}
+
+
+template <>
+inline
+unsigned int
+DoFObjectAccessor<1,2,hpDoFHandler>::dof_index (const unsigned int i) const
+{
+ // 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<2, hpDoFHandler> BaseClass;
+
+ Assert (this->dof_handler != 0, BaseClass::ExcInvalidObject());
+ // make sure a FE has been selected
+ // and enough room was reserved
+ Assert (&this->get_fe() != 0, BaseClass::ExcInvalidObject());
+ Assert (i<this->get_fe().dofs_per_line,
+ ExcIndexRange (i, 0, this->get_fe().dofs_per_line));
+
+ const unsigned int offset = this->dof_handler->levels[this->present_level]
+ ->dof_line_index_offset[this->present_index];
+ return this->dof_handler->levels[this->present_level]
+ ->line_dofs[offset+i];
+}
+
+
+template <>
+inline
+unsigned int
+DoFObjectAccessor<1,3,hpDoFHandler>::dof_index (const unsigned int i) const
+{
+ // 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<3, hpDoFHandler> BaseClass;
+
+ Assert (this->dof_handler != 0, BaseClass::ExcInvalidObject());
+ // make sure a FE has been selected
+ // and enough room was reserved
+ Assert (&this->get_fe() != 0, BaseClass::ExcInvalidObject());
+ Assert (i<this->get_fe().dofs_per_line,
+ ExcIndexRange (i, 0, this->get_fe().dofs_per_line));
+
+ const unsigned int offset = this->dof_handler->levels[this->present_level]
+ ->dof_line_index_offset[this->present_index];
+ return this->dof_handler->levels[this->present_level]
+ ->line_dofs[offset+i];
+}
+
+
+template <>
+inline
+const FiniteElement<1> &
+DoFObjectAccessor<1,1,hpDoFHandler>::get_fe () const
+{
+ return dof_handler->finite_elements->get_fe(active_fe_index ());
+}
+template <>
+inline
+const FiniteElement<2> &
+DoFObjectAccessor<1,2,hpDoFHandler>::get_fe () const
+{
+ return dof_handler->finite_elements->get_fe(active_fe_index ());
+}
+template <>
+inline
+const FiniteElement<3> &
+DoFObjectAccessor<1,3,hpDoFHandler>::get_fe () const
+{
+ return dof_handler->finite_elements->get_fe(active_fe_index ());
+}
+
+
+template <>
+inline
+unsigned int
+DoFObjectAccessor<1,1,hpDoFHandler>::active_fe_index () const
+{
+ Assert (static_cast<std::vector<unsigned int>::size_type>(this->present_index) <
+ dof_handler->levels[this->present_level]->active_fe_indices.size (),
+ ExcIndexRange (this->present_index, 0,
+ dof_handler->levels[this->present_level]->active_fe_indices.size ()));
+ return dof_handler->levels[this->present_level]
+ ->active_fe_indices[this->present_index];
+}
+template <>
+inline
+unsigned int
+DoFObjectAccessor<1,2,hpDoFHandler>::active_fe_index () const
+{
+ Assert (static_cast<std::vector<unsigned int>::size_type>(this->present_index) <
+ dof_handler->levels[this->present_level]->active_fe_indices.size (),
+ ExcIndexRange (this->present_index, 0,
+ dof_handler->levels[this->present_level]->active_fe_indices.size ()));
+ return dof_handler->levels[this->present_level]
+ ->active_fe_indices[this->present_index];
+}
+template <>
+inline
+unsigned int
+DoFObjectAccessor<1,3,hpDoFHandler>::active_fe_index () const
+{
+ Assert (static_cast<std::vector<unsigned int>::size_type>(this->present_index) <
+ dof_handler->levels[this->present_level]->active_fe_indices.size (),
+ ExcIndexRange (this->present_index, 0,
+ dof_handler->levels[this->present_level]->active_fe_indices.size ()));
+ return dof_handler->levels[this->present_level]
+ ->active_fe_indices[this->present_index];
+}
+
+
+template <>
+inline
+void
+DoFObjectAccessor<1,1,hpDoFHandler>::set_active_fe_index (const unsigned int i)
+{
+ Assert (dof_handler != 0, ExcInvalidObject());
+ Assert (static_cast<std::vector<unsigned int>::size_type>(this->present_index) <
+ dof_handler->levels[this->present_level]->active_fe_indices.size (),
+ ExcIndexRange (this->present_index, 0,
+ dof_handler->levels[this->present_level]->active_fe_indices.size ()));
+//TODO: dof_handler->finite_elements not always defined, when this method is called
+// Assert (i < dof_handler->finite_elements->n_finite_elements (), ExcInvalidObject());
+ dof_handler->levels[this->present_level]
+ ->active_fe_indices[this->present_index] = i;
+}
+template <>
+inline
+void
+DoFObjectAccessor<1,2,hpDoFHandler>::set_active_fe_index (const unsigned int i)
+{
+ Assert (dof_handler != 0, ExcInvalidObject());
+ Assert (static_cast<std::vector<unsigned int>::size_type>(this->present_index) <
+ dof_handler->levels[this->present_level]->active_fe_indices.size (),
+ ExcIndexRange (this->present_index, 0,
+ dof_handler->levels[this->present_level]->active_fe_indices.size ()));
+//TODO: dof_handler->finite_elements not always defined, when this method is called
+// Assert (i < dof_handler->finite_elements->n_finite_elements (), ExcInvalidObject());
+ dof_handler->levels[this->present_level]
+ ->active_fe_indices[this->present_index] = i;
+}
+template <>
+inline
+void
+DoFObjectAccessor<1,3,hpDoFHandler>::set_active_fe_index (const unsigned int i)
+{
+ Assert (dof_handler != 0, ExcInvalidObject());
+ Assert (static_cast<std::vector<unsigned int>::size_type>(this->present_index) <
+ dof_handler->levels[this->present_level]->active_fe_indices.size (),
+ ExcIndexRange (this->present_index, 0,
+ dof_handler->levels[this->present_level]->active_fe_indices.size ()));
+//TODO: dof_handler->finite_elements not always defined, when this method is called
+// Assert (i < dof_handler->finite_elements->n_finite_elements (), ExcInvalidObject());
+ dof_handler->levels[this->present_level]
+ ->active_fe_indices[this->present_index] = i;
+}
+
+
+/*------------- Functions: DoFObjectAccessor<2,dim,hpDoFHandler> -------------*/
+
+template <>
+inline
+unsigned int DoFObjectAccessor<2,2,hpDoFHandler>::dof_index (const unsigned int i) const
+{
+ typedef DoFAccessor<2, hpDoFHandler> BaseClass;
+
+ Assert (this->dof_handler != 0,
+ BaseClass::ExcInvalidObject());
+ // make sure a FE has been selected
+ // and enough room was reserved
+ Assert (&this->get_fe() != 0,
+ BaseClass::ExcInvalidObject());
+ Assert (i<this->get_fe().dofs_per_quad,
+ ExcIndexRange (i, 0, this->get_fe().dofs_per_quad));
+
+ const unsigned int offset = this->dof_handler->levels[this->present_level]
+ ->dof_quad_index_offset[this->present_index];
+ return this->dof_handler->levels[this->present_level]
+ ->quad_dofs[offset+i];
+}
+
+template <>
+inline
+unsigned int DoFObjectAccessor<2,3,hpDoFHandler>::dof_index (const unsigned int i) const
+{
+ typedef DoFAccessor<3, hpDoFHandler> BaseClass;
+
+ Assert (this->dof_handler != 0,
+ BaseClass::ExcInvalidObject());
+ // make sure a FE has been selected
+ // and enough room was reserved
+ Assert (&this->get_fe() != 0,
+ BaseClass::ExcInvalidObject());
+ Assert (i<this->get_fe().dofs_per_quad,
+ ExcIndexRange (i, 0, this->get_fe().dofs_per_quad));
+
+ const unsigned int offset = this->dof_handler->levels[this->present_level]
+ ->dof_quad_index_offset[this->present_index];
+ return this->dof_handler->levels[this->present_level]
+ ->quad_dofs[offset+i];
+}
+
+
+template <>
+inline
+const FiniteElement<2> &
+DoFObjectAccessor<2,2,hpDoFHandler>::get_fe () const
+{
+ return dof_handler->finite_elements->get_fe(active_fe_index ());
+}
+template <>
+inline
+const FiniteElement<3> &
+DoFObjectAccessor<2,3,hpDoFHandler>::get_fe () const
+{
+ return dof_handler->finite_elements->get_fe(active_fe_index ());
+}
+
+
+template <>
+inline
+unsigned int
+DoFObjectAccessor<2,2,hpDoFHandler>::active_fe_index () const
+{
+ Assert (static_cast<std::vector<unsigned int>::size_type>(this->present_index) <
+ dof_handler->levels[this->present_level]->active_fe_indices.size (),
+ ExcIndexRange (this->present_index, 0,
+ dof_handler->levels[this->present_level]->active_fe_indices.size ()));
+ return dof_handler->levels[this->present_level]
+ ->active_fe_indices[this->present_index];
+}
+
+
+
+template <>
+inline
+unsigned int
+DoFObjectAccessor<2,3,hpDoFHandler>::active_fe_index () const
+{
+ Assert (static_cast<std::vector<unsigned int>::size_type>(this->present_index) <
+ dof_handler->levels[this->present_level]->active_fe_indices.size (),
+ ExcIndexRange (this->present_index, 0,
+ dof_handler->levels[this->present_level]->active_fe_indices.size ()));
+ return dof_handler->levels[this->present_level]
+ ->active_fe_indices[this->present_index];
+}
+
+
+template <>
+inline
+void
+DoFObjectAccessor<2,2,hpDoFHandler>::set_active_fe_index (const unsigned int i)
+{
+ Assert (dof_handler != 0, ExcInvalidObject());
+ Assert (static_cast<std::vector<unsigned int>::size_type>(this->present_index) <
+ dof_handler->levels[this->present_level]->active_fe_indices.size (),
+ ExcIndexRange (this->present_index, 0,
+ dof_handler->levels[this->present_level]->active_fe_indices.size ()));
+//TODO: dof_handler->finite_elements not always defined, when this method is called
+// Assert (i < dof_handler->finite_elements->n_finite_elements (), ExcInvalidObject());
+ dof_handler->levels[this->present_level]
+ ->active_fe_indices[this->present_index] = i;
+}
+
+
+
+template <>
+inline
+void
+DoFObjectAccessor<2,3,hpDoFHandler>::set_active_fe_index (const unsigned int i)
+{
+ Assert (dof_handler != 0, ExcInvalidObject());
+ Assert (static_cast<std::vector<unsigned int>::size_type>(this->present_index) <
+ dof_handler->levels[this->present_level]->active_fe_indices.size (),
+ ExcIndexRange (this->present_index, 0,
+ dof_handler->levels[this->present_level]->active_fe_indices.size ()));
+//TODO: dof_handler->finite_elements not always defined, when this method is called
+// Assert (i < dof_handler->finite_elements->n_finite_elements (), ExcInvalidObject());
+ dof_handler->levels[this->present_level]
+ ->active_fe_indices[this->present_index] = i;
+}
+
+
+/*------------- Functions: DoFObjectAccessor<3,dim,hpDoFHandler> -------------*/
+
+template <>
+inline
+unsigned int
+DoFObjectAccessor<3,3,hpDoFHandler>::dof_index (const unsigned int i) const
+{
+ typedef DoFAccessor<3, hpDoFHandler> BaseClass;
+
+ Assert (this->dof_handler != 0,
+ BaseClass::ExcInvalidObject());
+ // make sure a FE has been selected
+ // and enough room was reserved
+ Assert (&this->get_fe() != 0,
+ BaseClass::ExcInvalidObject());
+ Assert (i<this->get_fe().dofs_per_hex,
+ ExcIndexRange (i, 0, this->get_fe().dofs_per_hex));
+
+ const unsigned int offset = this->dof_handler->levels[this->present_level]
+ ->dof_hex_index_offset[this->present_index];
+ return this->dof_handler->levels[this->present_level]
+ ->hex_dofs[offset+i];
+}
+
+
+template <>
+inline
+const FiniteElement<3> &
+DoFObjectAccessor<3,3,hpDoFHandler>::get_fe () const
+{
+ return dof_handler->finite_elements->get_fe(active_fe_index ());
+}
+
+
+template <>
+inline
+unsigned int
+DoFObjectAccessor<3,3,hpDoFHandler>::active_fe_index () const
+{
+ Assert (static_cast<std::vector<unsigned int>::size_type>(this->present_index) <
+ dof_handler->levels[this->present_level]->active_fe_indices.size (),
+ ExcIndexRange (this->present_index, 0,
+ dof_handler->levels[this->present_level]->active_fe_indices.size ()));
+ return dof_handler->levels[this->present_level]
+ ->active_fe_indices[this->present_index];
+}
+
+
+template <>
+inline
+void
+DoFObjectAccessor<3,3,hpDoFHandler>::set_active_fe_index (const unsigned int i)
+{
+ Assert (dof_handler != 0, ExcInvalidObject());
+ Assert (static_cast<std::vector<unsigned int>::size_type>(this->present_index) <
+ dof_handler->levels[this->present_level]->active_fe_indices.size (),
+ ExcIndexRange (this->present_index, 0,
+ dof_handler->levels[this->present_level]->active_fe_indices.size ()));
+//TODO: dof_handler->finite_elements not always defined, when this method is called
+// Assert (i < dof_handler->finite_elements->n_finite_elements (), ExcInvalidObject());
+ dof_handler->levels[this->present_level]
+ ->active_fe_indices[this->present_index] = i;
+}
+
+
#endif
#include <base/config.h>
#include <base/exceptions.h>
#include <base/smartpointer.h>
+#include <dofs/dof_iterator_selector.h>
#include <dofs/function_map.h>
+
#include <vector>
#include <map>
#include <set>
-template <int dim> class DoFAccessor;
-template <int dim> class DoFCellAccessor;
template <int dim> class DoFLevel;
-template <int celldim, int dim> class DoFObjectAccessor;
-template <int dim> class DoFObjectAccessor<0, dim>;
-template <int dim> class DoFObjectAccessor<1, dim>;
-template <int dim> class DoFObjectAccessor<2, dim>;
-template <int dim> class DoFObjectAccessor<3, dim>;
-template <int dim> class FiniteElement;
-template <int dim, typename Accessor> class TriaRawIterator;
-template <int dim, typename Accessor> class TriaIterator;
-template <int dim, typename Accessor> class TriaActiveIterator;
-template <int dim> class Triangulation;
-
-
-/**
- * Define some types which differ between the dimensions.
- *
- * @ref DoFDimensionInfo<1>
- * @ref DoFDimensionInfo<2>
- * @ref DoFDimensionInfo<3>
- *
- * @ingroup dofs
- * @author Wolfgang Bangerth, 1998
- */
-template <int dim>
-class DoFDimensionInfo
-{
- public:
- /**
- * For internal use only
- */
- typedef void * raw_line_iterator;
- /**
- * Iterator for lines in the
- * DoFHandler
- */
- typedef void * line_iterator;
- /**
- * Iterator skipping all refined
- * lines
- */
- typedef void * active_line_iterator;
-
- /**
- * For internal use only
- */
- typedef void * raw_quad_iterator;
- /**
- * Iterator for quadrilaterals in
- * the DoFHandler
- */
- typedef void * quad_iterator;
- /**
- * Iterator skipping all refined
- * quadrilaterals
- */
- typedef void * active_quad_iterator;
-
- /**
- * For internal use only
- */
- typedef void * raw_hex_iterator;
- /**
- * Iterator for hexahedra in the
- * DoFHandler
- */
- typedef void * hex_iterator;
- /**
- * Iterator skipping all refined
- * hexahedra
- */
- typedef void * active_hex_iterator;
-
- /**
- * For internal use only
- */
- typedef void * raw_cell_iterator;
- /**
- * All cells of the DoFHandler;
- * depending on the dimension
- * this is typedefed to
- * <ol>
- * <li> #line_iterator
- * <li> #quad_iterator
- * <li> #hex_iterator
- * </ol>
- */
- typedef void * cell_iterator;
- /**
- * All active cells of the DoFHandler
- * Depending on the dimension
- * this is typedefed to
- * <ol>
- * <li> #active_line_iterator
- * <li> #active_quad_iterator
- * <li> #active_hex_iterator
- * </ol>
- */
- typedef void * active_cell_iterator;
-
- /**
- * For internal use only
- */
- typedef void * raw_face_iterator;
- /**
- * All faces of the DoFHandler
- * Depending on the dimension
- * this is typedefed to
- * <ol>
- * <li> <tt>void*</tt>
- * <li> #line_iterator
- * <li> #quad_iterator
- * </ol>
- */
- typedef void * face_iterator;
- /**
- * All active faces of the DoFHandler
- * Depending on the dimension
- * this is typedefed to
- * <ol>
- * <li> <tt>void*</tt>
- * <li> #active_line_iterator
- * <li> #active_quad_iterator
- * </ol>
- */
- typedef void * active_face_iterator;
-};
-
-
-
-/**
- * Define some types for the DoF handling in one dimension.
- *
- * @ingroup dofs
- * @author Wolfgang Bangerth, 1998
- */
-template <>
-class DoFDimensionInfo<1>
-{
- public:
- typedef TriaRawIterator<1,DoFCellAccessor<1> > raw_line_iterator;
- typedef TriaIterator<1,DoFCellAccessor<1> > line_iterator;
- typedef TriaActiveIterator<1,DoFCellAccessor<1> > active_line_iterator;
-
- typedef void * raw_quad_iterator;
- typedef void * quad_iterator;
- typedef void * active_quad_iterator;
-
- typedef void * raw_hex_iterator;
- typedef void * hex_iterator;
- typedef void * active_hex_iterator;
-
- typedef raw_line_iterator raw_cell_iterator;
- typedef line_iterator cell_iterator;
- typedef active_line_iterator active_cell_iterator;
-
- typedef void * raw_face_iterator;
- typedef void * face_iterator;
- typedef void * active_face_iterator;
-};
-
-
-
-/**
- * Define some types for the DoF handling in two dimensions.
- *
- * @ingroup dofs
- * @author Wolfgang Bangerth, 1998
- */
-template <>
-class DoFDimensionInfo<2>
-{
- public:
- typedef TriaRawIterator<2,DoFObjectAccessor<1, 2> > raw_line_iterator;
- typedef TriaIterator<2,DoFObjectAccessor<1, 2> > line_iterator;
- typedef TriaActiveIterator<2,DoFObjectAccessor<1, 2> > active_line_iterator;
-
- typedef TriaRawIterator<2,DoFCellAccessor<2> > raw_quad_iterator;
- typedef TriaIterator<2,DoFCellAccessor<2> > quad_iterator;
- typedef TriaActiveIterator<2,DoFCellAccessor<2> > active_quad_iterator;
-
- typedef void * raw_hex_iterator;
- typedef void * hex_iterator;
- typedef void * active_hex_iterator;
-
- typedef raw_quad_iterator raw_cell_iterator;
- typedef quad_iterator cell_iterator;
- typedef active_quad_iterator active_cell_iterator;
-
- typedef raw_line_iterator raw_face_iterator;
- typedef line_iterator face_iterator;
- typedef active_line_iterator active_face_iterator;
-};
-
-
-
-/**
- * Define some types for the DoF handling in two dimensions.
- *
- * @ingroup dofs
- * @author Wolfgang Bangerth, 1998
- */
-template <>
-class DoFDimensionInfo<3>
-{
- public:
- typedef TriaRawIterator<3,DoFObjectAccessor<1, 3> > raw_line_iterator;
- typedef TriaIterator<3,DoFObjectAccessor<1, 3> > line_iterator;
- typedef TriaActiveIterator<3,DoFObjectAccessor<1, 3> > active_line_iterator;
-
- typedef TriaRawIterator<3,DoFObjectAccessor<2, 3> > raw_quad_iterator;
- typedef TriaIterator<3,DoFObjectAccessor<2, 3> > quad_iterator;
- typedef TriaActiveIterator<3,DoFObjectAccessor<2, 3> > active_quad_iterator;
-
- typedef TriaRawIterator<3,DoFCellAccessor<3> > raw_hex_iterator;
- typedef TriaIterator<3,DoFCellAccessor<3> > hex_iterator;
- typedef TriaActiveIterator<3,DoFCellAccessor<3> > active_hex_iterator;
-
- typedef raw_hex_iterator raw_cell_iterator;
- typedef hex_iterator cell_iterator;
- typedef active_hex_iterator active_cell_iterator;
-
- typedef raw_quad_iterator raw_face_iterator;
- typedef quad_iterator face_iterator;
- typedef active_quad_iterator active_face_iterator;
-};
-
/**
* @author Wolfgang Bangerth, 1998
*/
template <int dim>
-class DoFHandler : public Subscriptor,
- public DoFDimensionInfo<dim>
+class DoFHandler : public Subscriptor
{
+ typedef internal::DoFIteratorSelector<DoFHandler<dim> > IteratorSelector;
public:
- typedef typename DoFDimensionInfo<dim>::raw_line_iterator raw_line_iterator;
- typedef typename DoFDimensionInfo<dim>::line_iterator line_iterator;
- typedef typename DoFDimensionInfo<dim>::active_line_iterator active_line_iterator;
+ typedef typename IteratorSelector::raw_line_iterator raw_line_iterator;
+ typedef typename IteratorSelector::line_iterator line_iterator;
+ typedef typename IteratorSelector::active_line_iterator active_line_iterator;
- typedef typename DoFDimensionInfo<dim>::raw_quad_iterator raw_quad_iterator;
- typedef typename DoFDimensionInfo<dim>::quad_iterator quad_iterator;
- typedef typename DoFDimensionInfo<dim>::active_quad_iterator active_quad_iterator;
+ typedef typename IteratorSelector::raw_quad_iterator raw_quad_iterator;
+ typedef typename IteratorSelector::quad_iterator quad_iterator;
+ typedef typename IteratorSelector::active_quad_iterator active_quad_iterator;
- typedef typename DoFDimensionInfo<dim>::raw_hex_iterator raw_hex_iterator;
- typedef typename DoFDimensionInfo<dim>::hex_iterator hex_iterator;
- typedef typename DoFDimensionInfo<dim>::active_hex_iterator active_hex_iterator;
+ typedef typename IteratorSelector::raw_hex_iterator raw_hex_iterator;
+ typedef typename IteratorSelector::hex_iterator hex_iterator;
+ typedef typename IteratorSelector::active_hex_iterator active_hex_iterator;
- typedef typename DoFDimensionInfo<dim>::raw_cell_iterator raw_cell_iterator;
- typedef typename DoFDimensionInfo<dim>::cell_iterator cell_iterator;
- typedef typename DoFDimensionInfo<dim>::active_cell_iterator active_cell_iterator;
+ typedef typename IteratorSelector::raw_cell_iterator raw_cell_iterator;
+ typedef typename IteratorSelector::cell_iterator cell_iterator;
+ typedef typename IteratorSelector::active_cell_iterator active_cell_iterator;
- typedef typename DoFDimensionInfo<dim>::raw_face_iterator raw_face_iterator;
- typedef typename DoFDimensionInfo<dim>::face_iterator face_iterator;
- typedef typename DoFDimensionInfo<dim>::active_face_iterator active_face_iterator;
+ typedef typename IteratorSelector::raw_face_iterator raw_face_iterator;
+ typedef typename IteratorSelector::face_iterator face_iterator;
+ typedef typename IteratorSelector::active_face_iterator active_face_iterator;
/**
* Alias the @p FunctionMap type
n_boundary_dofs (const std::set<unsigned char> &boundary_indicators) const;
/**
- * Return a constant reference to the
- * selected finite element object. This
- * function is inline, so it should
- * be reasonably fast.
+ * Return a constant reference to
+ * the selected finite element
+ * object.
*/
const FiniteElement<dim> & get_fe () const;
/**
- * Return a constant reference to the
- * triangulation underlying this object.
+ * Return a constant reference to
+ * the triangulation underlying
+ * this object.
*/
const Triangulation<dim> & get_tria () const;
/*
* Make accessor objects friends.
*/
- template <int dim1> friend class DoFAccessor;
+ template <int dim1, template <int> class DH> friend class DoFAccessor;
/*
* Make accessor objects friends.
*/
- template <int dim1, int dim2> friend class DoFObjectAccessor;
+ template <int dim1, int dim2, template <int> class DH> friend class DoFObjectAccessor;
};
template <> DoFHandler<1>::cell_iterator DoFHandler<1>::last (const unsigned int level) const;
template <> DoFHandler<1>::active_cell_iterator DoFHandler<1>::last_active () const;
template <> DoFHandler<1>::active_cell_iterator DoFHandler<1>::last_active (const unsigned int level) const;
-template <> DoFDimensionInfo<1>::raw_face_iterator DoFHandler<1>::begin_raw_face (const unsigned int) const;
-template <> DoFDimensionInfo<1>::face_iterator DoFHandler<1>::begin_face (const unsigned int) const;
-template <> DoFDimensionInfo<1>::active_face_iterator DoFHandler<1>::begin_active_face (const unsigned int) const;
-template <> DoFDimensionInfo<1>::raw_face_iterator DoFHandler<1>::end_face () const;
-template <> DoFDimensionInfo<1>::raw_face_iterator DoFHandler<1>::last_raw_face () const;
-template <> DoFDimensionInfo<1>::raw_face_iterator DoFHandler<1>::last_raw_face (const unsigned int) const;
-template <> DoFDimensionInfo<1>::face_iterator DoFHandler<1>::last_face () const;
-template <> DoFDimensionInfo<1>::face_iterator DoFHandler<1>::last_face (const unsigned int) const;
-template <> DoFDimensionInfo<1>::active_face_iterator DoFHandler<1>::last_active_face () const;
-template <> DoFDimensionInfo<1>::active_face_iterator DoFHandler<1>::last_active_face (const unsigned int) const;
+template <> DoFHandler<1>::raw_face_iterator DoFHandler<1>::begin_raw_face (const unsigned int) const;
+template <> DoFHandler<1>::face_iterator DoFHandler<1>::begin_face (const unsigned int) const;
+template <> DoFHandler<1>::active_face_iterator DoFHandler<1>::begin_active_face (const unsigned int) const;
+template <> DoFHandler<1>::raw_face_iterator DoFHandler<1>::end_face () const;
+template <> DoFHandler<1>::raw_face_iterator DoFHandler<1>::last_raw_face () const;
+template <> DoFHandler<1>::raw_face_iterator DoFHandler<1>::last_raw_face (const unsigned int) const;
+template <> DoFHandler<1>::face_iterator DoFHandler<1>::last_face () const;
+template <> DoFHandler<1>::face_iterator DoFHandler<1>::last_face (const unsigned int) const;
+template <> DoFHandler<1>::active_face_iterator DoFHandler<1>::last_active_face () const;
+template <> DoFHandler<1>::active_face_iterator DoFHandler<1>::last_active_face (const unsigned int) const;
template <> DoFHandler<1>::raw_quad_iterator DoFHandler<1>::begin_raw_quad (const unsigned int) const;
template <> DoFHandler<1>::quad_iterator DoFHandler<1>::begin_quad (const unsigned int) const;
template <> DoFHandler<1>::active_quad_iterator DoFHandler<1>::begin_active_quad (const unsigned int) const;
template <> DoFHandler<2>::cell_iterator DoFHandler<2>::last (const unsigned int level) const;
template <> DoFHandler<2>::active_cell_iterator DoFHandler<2>::last_active () const;
template <> DoFHandler<2>::active_cell_iterator DoFHandler<2>::last_active (const unsigned int level) const;
-template <> DoFDimensionInfo<2>::raw_face_iterator DoFHandler<2>::begin_raw_face (const unsigned int level) const;
-template <> DoFDimensionInfo<2>::face_iterator DoFHandler<2>::begin_face (const unsigned int level) const;
-template <> DoFDimensionInfo<2>::active_face_iterator DoFHandler<2>::begin_active_face (const unsigned int level) const;
-template <> DoFDimensionInfo<2>::raw_face_iterator DoFHandler<2>::end_face () const;
-template <> DoFDimensionInfo<2>::raw_face_iterator DoFHandler<2>::last_raw_face () const;
-template <> DoFDimensionInfo<2>::raw_face_iterator DoFHandler<2>::last_raw_face (const unsigned int level) const;
-template <> DoFDimensionInfo<2>::face_iterator DoFHandler<2>::last_face () const;
-template <> DoFDimensionInfo<2>::face_iterator DoFHandler<2>::last_face (const unsigned int level) const;
-template <> DoFDimensionInfo<2>::active_face_iterator DoFHandler<2>::last_active_face () const;
-template <> DoFDimensionInfo<2>::active_face_iterator DoFHandler<2>::last_active_face (const unsigned int level) const;
+template <> DoFHandler<2>::raw_face_iterator DoFHandler<2>::begin_raw_face (const unsigned int level) const;
+template <> DoFHandler<2>::face_iterator DoFHandler<2>::begin_face (const unsigned int level) const;
+template <> DoFHandler<2>::active_face_iterator DoFHandler<2>::begin_active_face (const unsigned int level) const;
+template <> DoFHandler<2>::raw_face_iterator DoFHandler<2>::end_face () const;
+template <> DoFHandler<2>::raw_face_iterator DoFHandler<2>::last_raw_face () const;
+template <> DoFHandler<2>::raw_face_iterator DoFHandler<2>::last_raw_face (const unsigned int level) const;
+template <> DoFHandler<2>::face_iterator DoFHandler<2>::last_face () const;
+template <> DoFHandler<2>::face_iterator DoFHandler<2>::last_face (const unsigned int level) const;
+template <> DoFHandler<2>::active_face_iterator DoFHandler<2>::last_active_face () const;
+template <> DoFHandler<2>::active_face_iterator DoFHandler<2>::last_active_face (const unsigned int level) const;
template <> DoFHandler<2>::raw_hex_iterator DoFHandler<2>::begin_raw_hex (const unsigned int) const;
template <> DoFHandler<2>::hex_iterator DoFHandler<2>::begin_hex (const unsigned int) const;
template <> DoFHandler<2>::active_hex_iterator DoFHandler<2>::begin_active_hex (const unsigned int) const;
template <int dim>
inline
-unsigned int DoFHandler<dim>::n_dofs () const
+unsigned int
+DoFHandler<dim>::n_dofs () const
{
return used_dofs;
}
template <int dim>
inline
-const FiniteElement<dim> & DoFHandler<dim>::get_fe () const
+const FiniteElement<dim> &
+DoFHandler<dim>::get_fe () const
{
Assert(selected_fe!=0, ExcNoFESelected());
return *selected_fe;
}
-/*---------------------------- dof.h ---------------------------*/
+template <int dim>
+inline
+const Triangulation<dim> &
+DoFHandler<dim>::get_tria () const
+{
+ return *tria;
+}
+
+
+/*---------------------------- dof_handler.h ---------------------------*/
#endif
-/*---------------------------- dof.h ---------------------------*/
+/*---------------------------- dof_handler.h ---------------------------*/
--- /dev/null
+//---------------------------- dof_iterator_selector.h ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- dof_iterator_selector.h ---------------------------
+#ifndef __deal2__dof_iterator_selector_h
+#define __deal2__dof_iterator_selector_h
+
+template <int dim, template <int> class DH> class DoFAccessor;
+template <int dim, template <int> class DH> class DoFCellAccessor;
+template <int celldim, int dim, template <int> class DH> class DoFObjectAccessor;
+template <int dim, template <int> class DH> class DoFObjectAccessor<0, dim, DH>;
+template <int dim, template <int> class DH> class DoFObjectAccessor<1, dim, DH>;
+template <int dim, template <int> class DH> class DoFObjectAccessor<2, dim, DH>;
+template <int dim, template <int> class DH> class DoFObjectAccessor<3, dim, DH>;
+template <int dim> class FiniteElement;
+template <int dim, typename Accessor> class TriaRawIterator;
+template <int dim, typename Accessor> class TriaIterator;
+template <int dim, typename Accessor> class TriaActiveIterator;
+template <int dim> class Triangulation;
+template <int dim> class DoFHandler;
+
+
+namespace internal
+{
+/**
+ * Define some types which differ between the dimensions. This class
+ * is analogous to the TriaDimensionInfo class hierarchy.
+ *
+ * @ref DoFIteratorSelector<1>
+ * @ref DoFIteratorSelector<2>
+ * @ref DoFIteratorSelector<3>
+ *
+ * @author Wolfgang Bangerth, 1998; Oliver Kayser-Herold and Wolfgang Bangerth, 2003
+ */
+ template <class DH>
+ struct DoFIteratorSelector
+ {
+ };
+
+
+
+/**
+ * Define some types for the DoF handling in one dimension.
+ *
+ * The types have the same meaning as those declared in
+ * TriaDimensionInfo<2>, only the treatment of templates is a
+ * little more complicated since the @p DoFAccessor classes want a
+ * template template argument.
+ *
+ * @author Wolfgang Bangerth, 1998; Oliver Kayser-Herold and Wolfgang Bangerth, 2003
+ */
+ template <template <int> class DH>
+ struct DoFIteratorSelector<DH<1> >
+ {
+ typedef TriaRawIterator<1,DoFCellAccessor<1, DH> > raw_line_iterator;
+ typedef TriaIterator<1,DoFCellAccessor<1, DH> > line_iterator;
+ typedef TriaActiveIterator<1,DoFCellAccessor<1, DH> > active_line_iterator;
+
+ typedef void * raw_quad_iterator;
+ typedef void * quad_iterator;
+ typedef void * active_quad_iterator;
+
+ typedef void * raw_hex_iterator;
+ typedef void * hex_iterator;
+ typedef void * active_hex_iterator;
+
+ typedef raw_line_iterator raw_cell_iterator;
+ typedef line_iterator cell_iterator;
+ typedef active_line_iterator active_cell_iterator;
+
+ typedef void * raw_face_iterator;
+ typedef void * face_iterator;
+ typedef void * active_face_iterator;
+ };
+
+
+
+/**
+ * Define some types for the DoF handling in two dimensions.
+ *
+ * The types have the same meaning as those declared in
+ * TriaDimensionInfo<2>, only the treatment of templates is a
+ * little more complicated since the @p DoFAccessor classes want a
+ * template template argument.
+ *
+ * @author Wolfgang Bangerth, 1998; Oliver Kayser-Herold and Wolfgang Bangerth, 2003
+ */
+ template <template <int> class DH>
+ struct DoFIteratorSelector<DH<2> >
+ {
+ typedef TriaRawIterator<2,DoFObjectAccessor<1, 2, DH> > raw_line_iterator;
+ typedef TriaIterator<2,DoFObjectAccessor<1, 2, DH> > line_iterator;
+ typedef TriaActiveIterator<2,DoFObjectAccessor<1, 2, DH> > active_line_iterator;
+
+ typedef TriaRawIterator<2,DoFCellAccessor<2, DH> > raw_quad_iterator;
+ typedef TriaIterator<2,DoFCellAccessor<2, DH> > quad_iterator;
+ typedef TriaActiveIterator<2,DoFCellAccessor<2, DH> > active_quad_iterator;
+
+ typedef void * raw_hex_iterator;
+ typedef void * hex_iterator;
+ typedef void * active_hex_iterator;
+
+ typedef raw_quad_iterator raw_cell_iterator;
+ typedef quad_iterator cell_iterator;
+ typedef active_quad_iterator active_cell_iterator;
+
+ typedef raw_line_iterator raw_face_iterator;
+ typedef line_iterator face_iterator;
+ typedef active_line_iterator active_face_iterator;
+ };
+
+
+
+/**
+ * Define some types for the DoF handling in two dimensions.
+ *
+ * The types have the same meaning as those declared in
+ * TriaDimensionInfo<3>, only the treatment of templates is a
+ * little more complicated since the @p DoFAccessor classes want a
+ * template template argument.
+ *
+ * @author Wolfgang Bangerth, 1998; Oliver Kayser-Herold and Wolfgang Bangerth, 2003
+ */
+ template <template <int> class DH>
+ struct DoFIteratorSelector<DH<3> >
+ {
+ typedef TriaRawIterator<3,DoFObjectAccessor<1, 3, DH> > raw_line_iterator;
+ typedef TriaIterator<3,DoFObjectAccessor<1, 3, DH> > line_iterator;
+ typedef TriaActiveIterator<3,DoFObjectAccessor<1, 3, DH> > active_line_iterator;
+
+ typedef TriaRawIterator<3,DoFObjectAccessor<2, 3, DH> > raw_quad_iterator;
+ typedef TriaIterator<3,DoFObjectAccessor<2, 3, DH> > quad_iterator;
+ typedef TriaActiveIterator<3,DoFObjectAccessor<2, 3, DH> > active_quad_iterator;
+
+ typedef TriaRawIterator<3,DoFCellAccessor<3, DH> > raw_hex_iterator;
+ typedef TriaIterator<3,DoFCellAccessor<3, DH> > hex_iterator;
+ typedef TriaActiveIterator<3,DoFCellAccessor<3, DH> > active_hex_iterator;
+
+ typedef raw_hex_iterator raw_cell_iterator;
+ typedef hex_iterator cell_iterator;
+ typedef active_hex_iterator active_cell_iterator;
+
+ typedef raw_quad_iterator raw_face_iterator;
+ typedef quad_iterator face_iterator;
+ typedef active_quad_iterator active_face_iterator;
+ };
+}
+
+#endif // __deal2__dof_iterator_selector_h
* of this class for details on
* the different methods.
*/
- template <int dim>
+ template <int dim, template <int> class DH>
static void
- Cuthill_McKee (DoFHandler<dim> &dof_handler,
+ Cuthill_McKee (DH<dim> &dof_handler,
const bool reversed_numbering = false,
const bool use_constraints = false,
const std::vector<unsigned int> &starting_indices = std::vector<unsigned int>());
* returns the renumbering
* vector.
*/
- template <int dim>
+ template <int dim, template <int> class DH>
static void
compute_Cuthill_McKee (std::vector<unsigned int>& new_dof_indices,
- const DoFHandler<dim>&,
+ const DH<dim>&,
const bool reversed_numbering = false,
const bool use_constraints = false,
const std::vector<unsigned int> &starting_indices = std::vector<unsigned int>());
template <int dim> class Point;
template <int dim> class FiniteElement;
template <int dim> class DoFHandler;
+template <int dim> class hpDoFHandler;
template <int dim> class MGDoFHandler;
class ConstraintMatrix;
template <template <int> class GridClass, int dim> class InterGridMap;
* previously added entries are
* not deleted.
*/
- template <int dim, class SparsityPattern>
+ template <int dim, class SparsityPattern, template <int> class DH>
static
void
- make_sparsity_pattern (const DoFHandler<dim> &dof,
- SparsityPattern &sparsity_pattern);
+ make_sparsity_pattern (const DH<dim> &dof,
+ SparsityPattern &sparsity_pattern);
/**
* Locate non-zero entries for
* size of the sparsity pattern is
* already correct.
*/
- template <int dim, class SparsityPattern>
+ template <int dim, class SparsityPattern, template <int> class DH>
static void
- make_boundary_sparsity_pattern (const DoFHandler<dim> &dof,
+ make_boundary_sparsity_pattern (const DH<dim> &dof,
const std::vector<unsigned int> &dof_to_boundary_mapping,
SparsityPattern &sparsity_pattern);
* specified end points to each
* other.
*/
- template <class SparsityPattern>
+ template <class SparsityPattern, template <int> class DH>
static void
- make_boundary_sparsity_pattern (const DoFHandler<1> &dof,
+ make_boundary_sparsity_pattern (const DH<1> &dof,
const std::vector<unsigned int> &dof_to_boundary_mapping,
SparsityPattern &sparsity_pattern);
* pattern, the same holds as
* said above.
*/
- template <int dim, class SparsityPattern>
+ template <int dim, class SparsityPattern, template <int> class DH>
static void
- make_boundary_sparsity_pattern (const DoFHandler<dim> &dof,
+ make_boundary_sparsity_pattern (const DH<dim> &dof,
const typename FunctionMap<dim>::type &boundary_indicators,
const std::vector<unsigned int> &dof_to_boundary_mapping,
SparsityPattern &sparsity);
* specified end points to each
* other.
*/
- template <class SparsityPattern>
+ template <class SparsityPattern, template <int> class DH>
static void
- make_boundary_sparsity_pattern (const DoFHandler<1> &dof,
+ make_boundary_sparsity_pattern (const DH<1> &dof,
const FunctionMap<1>::type &boundary_indicators,
const std::vector<unsigned int> &dof_to_boundary_mapping,
SparsityPattern &sparsity);
* extra matrix entries are
* considered.
*/
- template<int dim, class SparsityPattern>
+ template<int dim, class SparsityPattern, template <int> class DH>
static void
- make_flux_sparsity_pattern (const DoFHandler<dim> &dof_handler,
- SparsityPattern &sparsity_pattern);
+ make_flux_sparsity_pattern (const DH<dim> &dof_handler,
+ SparsityPattern &sparsity_pattern);
/**
* Same function, but for 1d.
*/
- template<class SparsityPattern>
+ template<class SparsityPattern, template <int> class DH>
static void
- make_flux_sparsity_pattern (const DoFHandler<1> &dof_handler,
- SparsityPattern &sparsity_pattern);
+ make_flux_sparsity_pattern (const DH<1> &dof_handler,
+ SparsityPattern &sparsity_pattern);
/**
* This function does the same as
static void
make_hanging_node_constraints (const DoFHandler<3> &dof_handler,
ConstraintMatrix &constraints);
+
+ /**
+ * Declaration of same function
+ * for hpDoFHandler
+ */
+ static void
+ make_hanging_node_constraints (const hpDoFHandler<1> &dof_handler,
+ ConstraintMatrix &constraints);
+
+ /**
+ * Declaration of same function
+ * for different space dimension.
+ */
+ static void
+ make_hanging_node_constraints (const hpDoFHandler<2> &dof_handler,
+ ConstraintMatrix &constraints);
+
+ /**
+ * Declaration of same function
+ * for different space dimension.
+ */
+ static void
+ make_hanging_node_constraints (const hpDoFHandler<3> &dof_handler,
+ ConstraintMatrix &constraints);
+
//@}
/**
* speak: they are
* non-primitive).
*/
- template <int dim, typename Number>
+ template <int dim, typename Number, template <int> class DH>
static void
- distribute_cell_to_dof_vector (const DoFHandler<dim> &dof_handler,
+ distribute_cell_to_dof_vector (const DH<dim> &dof_handler,
const Vector<Number> &cell_data,
Vector<double> &dof_data,
const unsigned int component = 0);
*/
template <int dim>
static void
- extract_dofs (const DoFHandler<dim> &dof_handler,
- const std::vector<bool> &component_select,
- std::vector<bool> &selected_dofs);
+ extract_dofs (const DoFHandler<dim> &dof_handler,
+ const std::vector<bool> &component_select,
+ std::vector<bool> &selected_dofs);
/**
* Do the same thing as
* in the mask corresponding to
* later components are ignored.
*/
- template <int dim>
+ template <int dim, template <int> class DH>
static void
- extract_boundary_dofs (const DoFHandler<dim> &dof_handler,
+ extract_boundary_dofs (const DH<dim> &dof_handler,
const std::vector<bool> &component_select,
std::vector<bool> &selected_dofs,
const std::set<unsigned char> &boundary_indicators = std::set<unsigned char>());
* Declaration of same function
* for different space dimension.
*/
+ template <template <int> class DH>
static void
- extract_boundary_dofs (const DoFHandler<1> &dof_handler,
+ extract_boundary_dofs (const DH<1> &dof_handler,
const std::vector<bool> &component_select,
std::vector<bool> &selected_dofs,
const std::set<unsigned char> &boundary_indicators = std::set<unsigned char>());
* @p get_subdomain_association
* function.
*/
- template <int dim>
+ template <int dim, template <int> class DH>
static void
- extract_subdomain_dofs (const DoFHandler<dim> &dof_handler,
- const unsigned int subdomain_id,
- std::vector<bool> &selected_dofs);
-
+ extract_subdomain_dofs (const DH<dim> &dof_handler,
+ const unsigned int subdomain_id,
+ std::vector<bool> &selected_dofs);
+
/**
* For each DoF, return in the output
* array to which subdomain (as given by
std::vector<unsigned int>& dofs_per_component,
const bool vector_valued_once = false,
std::vector<unsigned int> target_component
- =std::vector<unsigned int>());
+ = std::vector<unsigned int>());
+
/**
* @deprecated See the previous
* Prior content of @p mapping
* is deleted.
*/
- template <int dim>
+ template <int dim, template <int> class DH>
static void
- map_dof_to_boundary_indices (const DoFHandler<dim> &dof_handler,
+ map_dof_to_boundary_indices (const DH<dim> &dof_handler,
std::vector<unsigned int> &mapping);
/**
* for different space dimension.
*/
static void
- map_dof_to_boundary_indices (const DoFHandler<1> &dof_handler,
- std::vector<unsigned int> &mapping);
+ map_dof_to_boundary_indices (const DoFHandler<1> &dof_handler,
+ std::vector<unsigned int> &mapping);
/**
* Same as the previous function,
* See the general doc of this
* class for more information.
*/
- template <int dim>
+ template <int dim, template <int> class DH>
static void
- map_dof_to_boundary_indices (const DoFHandler<dim> &dof_handler,
+ map_dof_to_boundary_indices (const DH<dim> &dof_handler,
const std::set<unsigned char> &boundary_indicators,
std::vector<unsigned int> &mapping);
* Declaration of same function
* for different space dimension.
*/
+ template <template <int> class DH>
static void
- map_dof_to_boundary_indices (const DoFHandler<1> &dof_handler,
+ map_dof_to_boundary_indices (const DH<1> &dof_handler,
const std::set<unsigned char> &boundary_indicators,
std::vector<unsigned int> &mapping);
* of support points of all its
* components.
*/
- template <int dim, class Comp>
+ template <int dim, template <int> class DH, class Comp>
static void
- map_support_points_to_dofs (const Mapping<dim> &mapping,
- const DoFHandler<dim> &dof_handler,
+ map_support_points_to_dofs (const Mapping<dim> &mapping,
+ const DH<dim> &dof_handler,
std::map<Point<dim>, unsigned int, Comp> &point_to_index_map);
/**
}
-template <int dim, class Comp>
+template <int dim, template <int> class DH, class Comp>
void
DoFTools::map_support_points_to_dofs (
const Mapping<dim> &mapping,
- const DoFHandler<dim> &dof_handler,
+ const DH<dim> &dof_handler,
std::map<Point<dim>, unsigned int, Comp> &point_to_index_map)
{
// let the checking of arguments be
--- /dev/null
+//---------------------------- hp_dof_handler.h ------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2003 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- hp_dof_handler.h ------------------------
+#ifndef __deal2__hp_dof_handler_h
+#define __deal2__hp_dof_handler_h
+
+
+
+#include <base/config.h>
+#include <base/exceptions.h>
+#include <base/smartpointer.h>
+#include <dofs/function_map.h>
+#include <dofs/dof_iterator_selector.h>
+#include <fe/fe_collection.h>
+
+#include <vector>
+#include <map>
+#include <set>
+
+template <int> class hpDoFLevel;
+
+
+/**
+ * Manage the distribution and numbering of the degrees of freedom for
+ * hp-FEM algorithms.
+ */
+template <int dim>
+class hpDoFHandler : public Subscriptor,
+ protected Triangulation<dim>::RefinementListener
+{
+ typedef internal::DoFIteratorSelector<hpDoFHandler<dim> > IteratorSelector;
+ public:
+ typedef typename IteratorSelector::raw_line_iterator raw_line_iterator;
+ typedef typename IteratorSelector::line_iterator line_iterator;
+ typedef typename IteratorSelector::active_line_iterator active_line_iterator;
+
+ typedef typename IteratorSelector::raw_quad_iterator raw_quad_iterator;
+ typedef typename IteratorSelector::quad_iterator quad_iterator;
+ typedef typename IteratorSelector::active_quad_iterator active_quad_iterator;
+
+ typedef typename IteratorSelector::raw_hex_iterator raw_hex_iterator;
+ typedef typename IteratorSelector::hex_iterator hex_iterator;
+ typedef typename IteratorSelector::active_hex_iterator active_hex_iterator;
+
+ typedef typename IteratorSelector::raw_cell_iterator raw_cell_iterator;
+ typedef typename IteratorSelector::cell_iterator cell_iterator;
+ typedef typename IteratorSelector::active_cell_iterator active_cell_iterator;
+
+ typedef typename IteratorSelector::raw_face_iterator raw_face_iterator;
+ typedef typename IteratorSelector::face_iterator face_iterator;
+ typedef typename IteratorSelector::active_face_iterator active_face_iterator;
+
+ /**
+ * Alias the @p FunctionMap type
+ * declared elsewhere.
+ */
+ typedef typename FunctionMap<dim>::type FunctionMap;
+
+ /**
+ * When the arrays holding the
+ * DoF indices are set up, but
+ * before they are filled with
+ * actual values, they are set to
+ * an invalid value, in order to
+ * monitor possible
+ * problems. This invalid value
+ * is the constant defined here.
+ *
+ * Please note that you should
+ * not rely on it having a
+ * certain value, but rather take
+ * its symbolic name.
+ */
+ static const unsigned int invalid_dof_index = static_cast<unsigned int>(-1);
+
+
+ /**
+ * Constructor. Take @p tria as the
+ * triangulation to work on.
+ */
+ hpDoFHandler (const Triangulation<dim> &tria);
+
+ /**
+ * Destructor.
+ */
+ virtual ~hpDoFHandler ();
+
+ /**
+ * Go through the triangulation and
+ * distribute the degrees of freedoms
+ * needed for the given finite element
+ * according to the given distribution
+ * method.
+ *
+ * A pointer of the transferred
+ * finite element is
+ * stored. Therefore, the
+ * lifetime of the finite element
+ * object shall be longer than
+ * that of this object. If you
+ * don't want this behaviour, you
+ * may want to call the @p clear
+ * member function which also
+ * releases the lock of this
+ * object to the finite element.
+ */
+ virtual void distribute_dofs (const FECollection<dim> &fe);
+
+ /**
+ * Clear all data of this object and
+ * especially delete the lock this object
+ * has to the finite element used the last
+ * time when @p distribute_dofs was called.
+ */
+ virtual void clear ();
+
+ /**
+ * Actually do the renumbering based on
+ * a list of new dof numbers for all the
+ * dofs.
+ *
+ * @p new_numbers is an array of integers
+ * with size equal to the number of dofs
+ * on the present grid. It stores the new
+ * indices after renumbering in the
+ * order of the old indices.
+ *
+ * This function is called by the
+ * @p renumber_dofs function after computing
+ * the ordering of the degrees of freedom.
+ * However, you can call this function
+ * yourself, which is necessary if a user
+ * wants to implement an ordering scheme
+ * herself, for example downwind numbering.
+ */
+ void renumber_dofs (const std::vector<unsigned int> &new_numbers);
+
+ /**
+ * Return the maximum number of
+ * degrees of freedom a degree of freedom
+ * in the given triangulation with the
+ * given finite element may couple with.
+ * This is the maximum number of entries
+ * per line in the system matrix; this
+ * information can therefore be used upon
+ * construction of the SparsityPattern
+ * object.
+ *
+ * The returned number is not really the
+ * maximum number but an estimate based
+ * on the finite element and the maximum
+ * number of cells meeting at a vertex.
+ * The number holds for the constrained
+ * matrix also.
+ *
+ * The determination of the number of
+ * couplings can be done by simple
+ * picture drawing. An example can be
+ * found in the implementation of this
+ * function.
+ */
+ unsigned int max_couplings_between_dofs () const;
+
+ /**
+ * Return the number of degrees of freedom
+ * located on the boundary another dof on
+ * the boundary can couple with.
+ *
+ * The number is the same as for
+ * @p max_coupling_between_dofs in one
+ * dimension less.
+ */
+ unsigned int max_couplings_between_boundary_dofs () const;
+
+ /**
+ * @name Cell iterator functions
+ */
+ /*@{*/
+ /**
+ * Iterator to the first cell, used
+ * or not, on level @p level. If a level
+ * has no cells, a past-the-end iterator
+ * is returned.
+ *
+ * This function calls @p begin_raw_line
+ * in 1D and @p begin_raw_quad in 2D.
+ */
+ raw_cell_iterator begin_raw (const unsigned int level = 0) const;
+
+ /**
+ * Iterator to the first used cell
+ * on level @p level.
+ *
+ * This function calls @p begin_line
+ * in 1D and @p begin_quad in 2D.
+ */
+ cell_iterator begin (const unsigned int level = 0) const;
+
+ /**
+ * Iterator to the first active
+ * cell on level @p level.
+ *
+ * This function calls @p begin_active_line
+ * in 1D and @p begin_active_quad in 2D.
+ */
+ active_cell_iterator begin_active(const unsigned int level = 0) const;
+
+ /**
+ * Iterator past the end; this
+ * iterator serves for comparisons of
+ * iterators with past-the-end or
+ * before-the-beginning states.
+ *
+ * This function calls @p end_line
+ * in 1D and @p end_quad in 2D.
+ */
+ raw_cell_iterator end () const;
+
+ /**
+ * Return an iterator which is the first
+ * iterator not on level. If @p level is
+ * the last level, then this returns
+ * <tt>end()</tt>.
+ */
+ cell_iterator end (const unsigned int level) const;
+
+ /**
+ * Return a raw iterator which is the first
+ * iterator not on level. If @p level is
+ * the last level, then this returns
+ * <tt>end()</tt>.
+ */
+ raw_cell_iterator end_raw (const unsigned int level) const;
+
+ /**
+ * Return an active iterator which is the
+ * first iterator not on level. If @p level
+ * is the last level, then this returns
+ * <tt>end()</tt>.
+ */
+ active_cell_iterator end_active (const unsigned int level) const;
+
+ /**
+ * Return an iterator pointing to the
+ * last cell, used or not.
+ *
+ * This function calls @p last_raw_line
+ * in 1D and @p last_raw_quad in 2D.
+ */
+ raw_cell_iterator last_raw () const;
+
+ /**
+ * Return an iterator pointing to the last
+ * cell of the level @p level, used or not.
+ *
+ * This function calls @p last_raw_line
+ * in 1D and @p last_raw_quad in 2D.
+ */
+ raw_cell_iterator last_raw (const unsigned int level) const;
+
+ /**
+ * Return an iterator pointing to the last
+ * used cell.
+ *
+ * This function calls @p last_line
+ * in 1D and @p last_quad in 2D.
+ */
+ cell_iterator last () const;
+
+ /**
+ * Return an iterator pointing to the last
+ * used cell on level @p level.
+ *
+ * This function calls @p last_line
+ * in 1D and @p last_quad in 2D.
+ */
+ cell_iterator last (const unsigned int level) const;
+
+ /**
+ * Return an iterator pointing to the last
+ * active cell.
+ *
+ * This function calls @p last_active_line
+ * in 1D and @p last_active_quad in 2D.
+ */
+ active_cell_iterator last_active () const;
+
+ /**
+ * Return an iterator pointing to the last
+ * active cell on level @p level.
+ *
+ * This function calls @p last_active_line
+ * in 1D and @p last_active_quad in 2D.
+ */
+ active_cell_iterator last_active (const unsigned int level) const;
+ //@}
+
+ /*---------------------------------------*/
+
+ /**
+ * @name Face iterator functions
+ */
+ /*@{*/
+ /**
+ * Iterator to the first face, used
+ * or not, on level @p level. If a level
+ * has no faces, a past-the-end iterator
+ * is returned.
+ *
+ * This function calls @p begin_raw_line
+ * in 2D and @p begin_raw_quad in 3D.
+ */
+ raw_face_iterator begin_raw_face (const unsigned int level = 0) const;
+
+ /**
+ * Iterator to the first used face
+ * on level @p level.
+ *
+ * This function calls @p begin_line
+ * in 2D and @p begin_quad in 3D.
+ */
+ face_iterator begin_face (const unsigned int level = 0) const;
+
+ /**
+ * Iterator to the first active
+ * face on level @p level.
+ *
+ * This function calls @p begin_active_line
+ * in 2D and @p begin_active_quad in 3D.
+ */
+ active_face_iterator begin_active_face(const unsigned int level = 0) const;
+
+ /**
+ * Iterator past the end; this
+ * iterator serves for comparisons of
+ * iterators with past-the-end or
+ * before-the-beginning states.
+ *
+ * This function calls @p end_line
+ * in 2D and @p end_quad in 3D.
+ */
+ raw_face_iterator end_face () const;
+
+ /**
+ * Return an iterator which is the first
+ * iterator not on level. If @p level is
+ * the last level, then this returns
+ * <tt>end()</tt>.
+ */
+ face_iterator end_face (const unsigned int level) const;
+
+ /**
+ * Return a raw iterator which is the first
+ * iterator not on level. If @p level is
+ * the last level, then this returns
+ * <tt>end()</tt>.
+ */
+ raw_face_iterator end_raw_face (const unsigned int level) const;
+
+ /**
+ * Return an active iterator which is the
+ * first iterator not on level. If @p level
+ * is the last level, then this returns
+ * <tt>end()</tt>.
+ */
+ active_face_iterator end_active_face (const unsigned int level) const;
+
+ /**
+ * Return an iterator pointing to the
+ * last face, used or not.
+ *
+ * This function calls @p last_raw_line
+ * in 2D and @p last_raw_quad in 3D.
+ */
+ raw_face_iterator last_raw_face () const;
+
+ /**
+ * Return an iterator pointing to the last
+ * face of the level @p level, used or not.
+ *
+ * This function calls @p last_raw_line
+ * in 2D and @p last_raw_quad in 3D.
+ */
+ raw_face_iterator last_raw_face (const unsigned int level) const;
+
+ /**
+ * Return an iterator pointing to the last
+ * used face.
+ *
+ * This function calls @p last_line
+ * in 2D and @p last_quad in 3D.
+ */
+ face_iterator last_face () const;
+
+ /**
+ * Return an iterator pointing to the last
+ * used face on level @p level.
+ *
+ * This function calls @p last_line
+ * in 2D and @p last_quad in 3D.
+ */
+ face_iterator last_face (const unsigned int level) const;
+
+ /**
+ * Return an iterator pointing to the last
+ * active face.
+ *
+ * This function calls @p last_active_line
+ * in 2D and @p last_active_quad in 3D.
+ */
+ active_face_iterator last_active_face () const;
+
+ /**
+ * Return an iterator pointing to the last
+ * active face on level @p level.
+ *
+ * This function calls @p last_active_line
+ * in 2D and @p last_active_quad in 3D.
+ */
+ active_face_iterator last_active_face (const unsigned int level) const;
+ //@}
+
+
+ /*---------------------------------------*/
+
+ /**
+ * @name Line iterator functions
+ */
+ /*@{*/
+ /**
+ * Iterator to the first line, used
+ * or not, on level @p level. If a level
+ * has no lines, a past-the-end iterator
+ * is returned.
+ */
+ raw_line_iterator begin_raw_line (const unsigned int level = 0) const;
+
+ /**
+ * Iterator to the first used line
+ * on level @p level.
+ */
+ line_iterator begin_line (const unsigned int level = 0) const;
+
+ /**
+ * Iterator to the first active
+ * line on level @p level.
+ */
+ active_line_iterator begin_active_line(const unsigned int level = 0) const;
+
+ /**
+ * Iterator past the end; this
+ * iterator serves for comparisons of
+ * iterators with past-the-end or
+ * before-the-beginning states.
+ */
+ raw_line_iterator end_line () const;
+
+ /**
+ * Return an iterator which is the first
+ * iterator not on level. If @p level is
+ * the last level, then this returns
+ * <tt>end()</tt>.
+ */
+ line_iterator end_line (const unsigned int level) const;
+
+ /**
+ * Return a raw iterator which is the first
+ * iterator not on level. If @p level is
+ * the last level, then this returns
+ * <tt>end()</tt>.
+ */
+ raw_line_iterator end_raw_line (const unsigned int level) const;
+
+ /**
+ * Return an active iterator which is the
+ * first iterator not on level. If @p level
+ * is the last level, then this returns
+ * <tt>end()</tt>.
+ */
+ active_line_iterator end_active_line (const unsigned int level) const;
+
+
+ /**
+ * Return an iterator pointing to the
+ * last line, used or not.
+ */
+ raw_line_iterator last_raw_line () const;
+
+ /**
+ * Return an iterator pointing to the last
+ * line of the level @p level, used or not.
+
+ */
+ raw_line_iterator last_raw_line (const unsigned int level) const;
+
+ /**
+ * Return an iterator pointing to the last
+ * used line.
+ */
+ line_iterator last_line () const;
+
+ /**
+ * Return an iterator pointing to the last
+ * used line on level @p level.
+ */
+ line_iterator last_line (const unsigned int level) const;
+
+ /**
+ * Return an iterator pointing to the last
+ * active line.
+ */
+ active_line_iterator last_active_line () const;
+
+ /**
+ * Return an iterator pointing to the last
+ * active line on level @p level.
+ */
+ active_line_iterator last_active_line (const unsigned int level) const;
+ /*@}*/
+
+ /*---------------------------------------*/
+
+ /**
+ * @name Quad iterator functions*/
+ /*@{
+ */
+ /**
+ * Iterator to the first quad, used
+ * or not, on level @p level. If a level
+ * has no quads, a past-the-end iterator
+ * is returned.
+ */
+ raw_quad_iterator begin_raw_quad (const unsigned int level = 0) const;
+
+ /**
+ * Iterator to the first used quad
+ * on level @p level.
+ */
+ quad_iterator begin_quad (const unsigned int level = 0) const;
+
+ /**
+ * Iterator to the first active
+ * quad on level @p level.
+ */
+ active_quad_iterator begin_active_quad(const unsigned int level = 0) const;
+
+ /**
+ * Iterator past the end; this
+ * iterator serves for comparisons of
+ * iterators with past-the-end or
+ * before-the-beginning states.
+ */
+ raw_quad_iterator end_quad () const;
+
+ /**
+ * Return an iterator which is the first
+ * iterator not on level. If @p level is
+ * the last level, then this returns
+ * <tt>end()</tt>.
+ */
+ quad_iterator end_quad (const unsigned int level) const;
+
+ /**
+ * Return a raw iterator which is the first
+ * iterator not on level. If @p level is
+ * the last level, then this returns
+ * <tt>end()</tt>.
+ */
+ raw_quad_iterator end_raw_quad (const unsigned int level) const;
+
+ /**
+ * Return an active iterator which is the
+ * first iterator not on level. If @p level
+ * is the last level, then this returns
+ * <tt>end()</tt>.
+ */
+ active_quad_iterator end_active_quad (const unsigned int level) const;
+
+
+ /**
+ * Return an iterator pointing to the
+ * last quad, used or not.
+ */
+ raw_quad_iterator last_raw_quad () const;
+
+ /**
+ * Return an iterator pointing to the last
+ * quad of the level @p level, used or not.
+
+ */
+ raw_quad_iterator last_raw_quad (const unsigned int level) const;
+
+ /**
+ * Return an iterator pointing to the last
+ * used quad.
+ */
+ quad_iterator last_quad () const;
+
+ /**
+ * Return an iterator pointing to the last
+ * used quad on level @p level.
+ */
+ quad_iterator last_quad (const unsigned int level) const;
+
+ /**
+ * Return an iterator pointing to the last
+ * active quad.
+ */
+ active_quad_iterator last_active_quad () const;
+
+ /**
+ * Return an iterator pointing to the last
+ * active quad on level @p level.
+ */
+ active_quad_iterator last_active_quad (const unsigned int level) const;
+ /*@}*/
+
+ /*---------------------------------------*/
+
+ /**
+ * @name Hex iterator functions*/
+ /*@{
+ */
+ /**
+ * Iterator to the first hex, used
+ * or not, on level @p level. If a level
+ * has no hexs, a past-the-end iterator
+ * is returned.
+ */
+ raw_hex_iterator
+ begin_raw_hex (const unsigned int level = 0) const;
+
+ /**
+ * Iterator to the first used hex
+ * on level @p level.
+ */
+ hex_iterator
+ begin_hex (const unsigned int level = 0) const;
+
+ /**
+ * Iterator to the first active
+ * hex on level @p level.
+ */
+ active_hex_iterator
+ begin_active_hex(const unsigned int level = 0) const;
+
+ /**
+ * Iterator past the end; this
+ * iterator serves for comparisons of
+ * iterators with past-the-end or
+ * before-the-beginning states.
+ */
+ raw_hex_iterator
+ end_hex () const;
+
+ /**
+ * Return an iterator which is the first
+ * iterator not on level. If @p level is
+ * the last level, then this returns
+ * <tt>end()</tt>.
+ */
+ hex_iterator end_hex (const unsigned int level) const;
+
+ /**
+ * Return a raw iterator which is the first
+ * iterator not on level. If @p level is
+ * the last level, then this returns
+ * <tt>end()</tt>.
+ */
+ raw_hex_iterator end_raw_hex (const unsigned int level) const;
+
+ /**
+ * Return an active iterator which is the
+ * first iterator not on level. If @p level
+ * is the last level, then this returns
+ * <tt>end()</tt>.
+ */
+ active_hex_iterator end_active_hex (const unsigned int level) const;
+
+ /**
+ * Return an iterator pointing to the
+ * last hex, used or not.
+ */
+ raw_hex_iterator
+ last_raw_hex () const;
+
+ /**
+ * Return an iterator pointing to the last
+ * hex of the level @p level, used or not.
+
+ */
+ raw_hex_iterator
+ last_raw_hex (const unsigned int level) const;
+
+ /**
+ * Return an iterator pointing to the last
+ * used hex.
+ */
+ hex_iterator
+ last_hex () const;
+
+ /**
+ * Return an iterator pointing to the last
+ * used hex on level @p level.
+ */
+ hex_iterator
+ last_hex (const unsigned int level) const;
+
+ /**
+ * Return an iterator pointing to the last
+ * active hex.
+ */
+ active_hex_iterator
+ last_active_hex () const;
+
+ /**
+ * Return an iterator pointing to the last
+ * active hex on level @p level.
+ */
+ active_hex_iterator
+ last_active_hex (const unsigned int level) const;
+ /*@}*/
+
+ /*---------------------------------------*/
+
+
+ /**
+ * Return number of degrees of freedom.
+ * Included in this number are those
+ * DoFs which are constrained by
+ * hanging nodes.
+ */
+ unsigned int n_dofs () const;
+
+ /**
+ * Return the number of degrees of freedom
+ * located on the boundary.
+ */
+ unsigned int n_boundary_dofs () const;
+
+ /**
+ * Return the number of degrees
+ * of freedom located on those
+ * parts of the boundary which
+ * have a boundary indicator
+ * listed in the given set. The
+ * reason that a @p map rather
+ * than a @p set is used is the
+ * same as descibed in the
+ * section on the
+ * @p make_boundary_sparsity_pattern
+ * function.
+ */
+ unsigned int
+ n_boundary_dofs (const FunctionMap &boundary_indicators) const;
+
+ /**
+ * Same function, but with
+ * different data type of the
+ * argument, which is here simply
+ * a list of the boundary
+ * indicators under
+ * consideration.
+ */
+ unsigned int
+ n_boundary_dofs (const std::set<unsigned char> &boundary_indicators) const;
+
+ /**
+ * Return a constant reference to
+ * the set of finite element
+ * objects that are used by this
+ * @p hpDoFHandler.
+ */
+ const FECollection<dim> & get_fe () const;
+
+ /**
+ * Return a constant reference to the
+ * triangulation underlying this object.
+ */
+ const Triangulation<dim> & get_tria () const;
+
+ /**
+ * Determine an estimate for the
+ * memory consumption (in bytes)
+ * of this object.
+ *
+ * This function is made virtual,
+ * since a dof handler object
+ * might be accessed through a
+ * pointers to thisr base class,
+ * although the actual object
+ * might be a derived class.
+ */
+ virtual unsigned int memory_consumption () const;
+
+ /**
+ * Exception
+ */
+ DeclException0 (ExcInvalidTriangulation);
+ /**
+ * Exception
+ */
+ DeclException0 (ExcNoFESelected);
+ /**
+ * Exception
+ */
+ DeclException0 (ExcRenumberingIncomplete);
+ /**
+ * Exception
+ */
+ DeclException0 (ExcGridsDoNotMatch);
+ /**
+ * Exception
+ */
+ DeclException0 (ExcInvalidBoundaryIndicator);
+ /**
+ * Exception
+ */
+ DeclException1 (ExcMatrixHasWrongSize,
+ int,
+ << "The matrix has the wrong dimension " << arg1);
+ /**
+ * Exception
+ */
+ DeclException0 (ExcFunctionNotUseful);
+ /**
+ * Exception
+ */
+ DeclException1 (ExcNewNumbersNotConsecutive,
+ int,
+ << "The given list of new dof indices is not consecutive: "
+ << "the index " << arg1 << " does not exist.");
+
+ protected:
+
+ /**
+ * Address of the triangulation to
+ * work on.
+ */
+ SmartPointer<const Triangulation<dim> > tria;
+
+ /**
+ * Store a pointer to the finite
+ * element set given latest for
+ * the distribution of dofs. In
+ * order to avoid destruction of
+ * the object before the lifetime
+ * of the DoF handler, we
+ * subscribe to the finite
+ * element object. To unlock the
+ * FE before the end of the
+ * lifetime of this DoF handler,
+ * use the <tt>clear()</tt> function
+ * (this clears all data of this
+ * object as well, though).
+ */
+ SmartPointer<const FECollection<dim> > finite_elements;
+
+ private:
+
+ /**
+ * Copy constructor. I can see no reason
+ * why someone might want to use it, so
+ * I don't provide it. Since this class
+ * has pointer members, making it private
+ * prevents the compiler to provide it's
+ * own, incorrect one if anyone chose to
+ * copy such an object.
+ */
+ hpDoFHandler (const hpDoFHandler &);
+
+ /**
+ * Copy operator. I can see no reason
+ * why someone might want to use it, so
+ * I don't provide it. Since this class
+ * has pointer members, making it private
+ * prevents the compiler to provide it's
+ * own, incorrect one if anyone chose to
+ * copy such an object.
+ */
+ hpDoFHandler & operator = (const hpDoFHandler &);
+
+ /**
+ * Reserve enough space in the
+ * <tt>levels[]</tt> objects to store the
+ * numbers of the degrees of freedom
+ * needed for the given element. The
+ * given element is that one which
+ * was selected when calling
+ * @p distribute_dofs the last time.
+ */
+ void reserve_space ();
+
+ /**
+ * Free all used memory.
+ */
+ void clear_space ();
+
+ /**
+ * Distribute dofs on the given cell,
+ * with new dofs starting with index
+ * @p next_free_dof. Return the next
+ * unused index number. The finite
+ * element used is the one given to
+ * @p distribute_dofs, which is copied
+ * to @p selected_fe.
+ *
+ * This function is excluded from the
+ * @p distribute_dofs function since
+ * it can not be implemented dimension
+ * independent.
+ */
+ unsigned int distribute_dofs_on_cell (active_cell_iterator &cell,
+ unsigned int next_free_dof);
+
+
+ /**
+ * Create default tables for the
+ * active_fe_indices in the
+ * hpDoFLevel()s. They are
+ * initialized with the base fe.
+ * This method is called before
+ * refinement and before distribute_dofs
+ * is called. It ensures each cell has
+ * a valid active_fe_index.
+ */
+
+ void create_active_fe_table ();
+
+ /**
+ * Methods of the RefinementListener
+ * coming from the Triangulation.
+ * Here they are used to administrate the
+ * the active_fe_fields during the spatial
+ * refinement.
+ */
+
+ virtual void pre_refinement_notification (const Triangulation<dim> &tria);
+ virtual void post_refinement_notification (const Triangulation<dim> &tria);
+
+
+ /**
+ * Space to store the DoF numbers for the
+ * different levels. Analogous to the
+ * <tt>levels[]</tt> tree of the Triangulation
+ * objects.
+ */
+ std::vector<hpDoFLevel<dim>*> levels;
+
+ /**
+ * Store the number of dofs created last
+ * time.
+ */
+ unsigned int used_dofs;
+
+ /**
+ * Array to store the indices for degrees
+ * of freedom located at vertices.
+ */
+ std::vector<unsigned int> vertex_dofs;
+
+ /**
+ * Array to store the information, if a
+ * cell on some level has children or
+ * not. It is used by the refinement
+ * listeners as a persistent buffer during
+ * the refinement.
+ */
+ std::vector<std::vector<bool> *> has_children;
+
+ /**
+ * Make accessor objects friends.
+ */
+ template <int dim1, template <int> class DH> friend class DoFAccessor;
+
+ /**
+ * Make accessor objects friends.
+ */
+ template <int dim1, int dim2, template <int> class DH> friend class DoFObjectAccessor;
+
+ /**
+ * Make Triangulation friend.
+ */
+// friend class Triangulation<dim>;
+};
+
+
+
+
+/* -------------- declaration of explicit specializations ------------- */
+
+template <> unsigned int hpDoFHandler<1>::n_boundary_dofs () const;
+template <> unsigned int hpDoFHandler<1>::n_boundary_dofs (const FunctionMap &) const;
+template <> unsigned int hpDoFHandler<1>::n_boundary_dofs (const std::set<unsigned char> &) const;
+template <> unsigned int hpDoFHandler<1>::max_couplings_between_dofs () const;
+template <> unsigned int hpDoFHandler<1>::max_couplings_between_boundary_dofs () const;
+template <> unsigned int hpDoFHandler<2>::max_couplings_between_dofs () const;
+template <> unsigned int hpDoFHandler<2>::max_couplings_between_boundary_dofs () const;
+template <> unsigned int hpDoFHandler<3>::max_couplings_between_dofs () const;
+template <> unsigned int hpDoFHandler<3>::max_couplings_between_boundary_dofs () const;
+
+template <> hpDoFHandler<1>::raw_cell_iterator hpDoFHandler<1>::begin_raw (const unsigned int level) const;
+template <> hpDoFHandler<1>::cell_iterator hpDoFHandler<1>::begin (const unsigned int level) const;
+template <> hpDoFHandler<1>::active_cell_iterator hpDoFHandler<1>::begin_active (const unsigned int level) const;
+template <> hpDoFHandler<1>::raw_cell_iterator hpDoFHandler<1>::end () const;
+template <> hpDoFHandler<1>::raw_cell_iterator hpDoFHandler<1>::last_raw () const;
+template <> hpDoFHandler<1>::raw_cell_iterator hpDoFHandler<1>::last_raw (const unsigned int level) const;
+template <> hpDoFHandler<1>::cell_iterator hpDoFHandler<1>::last () const;
+template <> hpDoFHandler<1>::cell_iterator hpDoFHandler<1>::last (const unsigned int level) const;
+template <> hpDoFHandler<1>::active_cell_iterator hpDoFHandler<1>::last_active () const;
+template <> hpDoFHandler<1>::active_cell_iterator hpDoFHandler<1>::last_active (const unsigned int level) const;
+template <> hpDoFHandler<1>::raw_face_iterator hpDoFHandler<1>::begin_raw_face (const unsigned int) const;
+template <> hpDoFHandler<1>::face_iterator hpDoFHandler<1>::begin_face (const unsigned int) const;
+template <> hpDoFHandler<1>::active_face_iterator hpDoFHandler<1>::begin_active_face (const unsigned int) const;
+template <> hpDoFHandler<1>::raw_face_iterator hpDoFHandler<1>::end_face () const;
+template <> hpDoFHandler<1>::raw_face_iterator hpDoFHandler<1>::last_raw_face () const;
+template <> hpDoFHandler<1>::raw_face_iterator hpDoFHandler<1>::last_raw_face (const unsigned int) const;
+template <> hpDoFHandler<1>::face_iterator hpDoFHandler<1>::last_face () const;
+template <> hpDoFHandler<1>::face_iterator hpDoFHandler<1>::last_face (const unsigned int) const;
+template <> hpDoFHandler<1>::active_face_iterator hpDoFHandler<1>::last_active_face () const;
+template <> hpDoFHandler<1>::active_face_iterator hpDoFHandler<1>::last_active_face (const unsigned int) const;
+template <> hpDoFHandler<1>::raw_quad_iterator hpDoFHandler<1>::begin_raw_quad (const unsigned int) const;
+template <> hpDoFHandler<1>::quad_iterator hpDoFHandler<1>::begin_quad (const unsigned int) const;
+template <> hpDoFHandler<1>::active_quad_iterator hpDoFHandler<1>::begin_active_quad (const unsigned int) const;
+template <> hpDoFHandler<1>::raw_quad_iterator hpDoFHandler<1>::end_quad () const;
+template <> hpDoFHandler<1>::raw_quad_iterator hpDoFHandler<1>::last_raw_quad (const unsigned int) const;
+template <> hpDoFHandler<1>::quad_iterator hpDoFHandler<1>::last_quad (const unsigned int) const;
+template <> hpDoFHandler<1>::active_quad_iterator hpDoFHandler<1>::last_active_quad (const unsigned int) const;
+template <> hpDoFHandler<1>::raw_quad_iterator hpDoFHandler<1>::last_raw_quad () const;
+template <> hpDoFHandler<1>::quad_iterator hpDoFHandler<1>::last_quad () const;
+template <> hpDoFHandler<1>::active_quad_iterator hpDoFHandler<1>::last_active_quad () const;
+template <> hpDoFHandler<1>::raw_hex_iterator hpDoFHandler<1>::begin_raw_hex (const unsigned int) const;
+template <> hpDoFHandler<1>::hex_iterator hpDoFHandler<1>::begin_hex (const unsigned int) const;
+template <> hpDoFHandler<1>::active_hex_iterator hpDoFHandler<1>::begin_active_hex (const unsigned int) const;
+template <> hpDoFHandler<1>::raw_hex_iterator hpDoFHandler<1>::end_hex () const;
+template <> hpDoFHandler<1>::raw_hex_iterator hpDoFHandler<1>::last_raw_hex (const unsigned int) const;
+template <> hpDoFHandler<1>::raw_hex_iterator hpDoFHandler<1>::last_raw_hex () const;
+template <> hpDoFHandler<1>::hex_iterator hpDoFHandler<1>::last_hex (const unsigned int) const;
+template <> hpDoFHandler<1>::hex_iterator hpDoFHandler<1>::last_hex () const;
+template <> hpDoFHandler<1>::active_hex_iterator hpDoFHandler<1>::last_active_hex (const unsigned int) const;
+template <> hpDoFHandler<1>::active_hex_iterator hpDoFHandler<1>::last_active_hex () const;
+template <> hpDoFHandler<2>::raw_cell_iterator hpDoFHandler<2>::begin_raw (const unsigned int level) const;
+template <> hpDoFHandler<2>::cell_iterator hpDoFHandler<2>::begin (const unsigned int level) const;
+template <> hpDoFHandler<2>::active_cell_iterator hpDoFHandler<2>::begin_active (const unsigned int level) const;
+template <> hpDoFHandler<2>::raw_cell_iterator hpDoFHandler<2>::end () const;
+template <> hpDoFHandler<2>::raw_cell_iterator hpDoFHandler<2>::last_raw () const;
+template <> hpDoFHandler<2>::raw_cell_iterator hpDoFHandler<2>::last_raw (const unsigned int level) const;
+template <> hpDoFHandler<2>::cell_iterator hpDoFHandler<2>::last () const;
+template <> hpDoFHandler<2>::cell_iterator hpDoFHandler<2>::last (const unsigned int level) const;
+template <> hpDoFHandler<2>::active_cell_iterator hpDoFHandler<2>::last_active () const;
+template <> hpDoFHandler<2>::active_cell_iterator hpDoFHandler<2>::last_active (const unsigned int level) const;
+template <> hpDoFHandler<2>::raw_face_iterator hpDoFHandler<2>::begin_raw_face (const unsigned int level) const;
+template <> hpDoFHandler<2>::face_iterator hpDoFHandler<2>::begin_face (const unsigned int level) const;
+template <> hpDoFHandler<2>::active_face_iterator hpDoFHandler<2>::begin_active_face (const unsigned int level) const;
+template <> hpDoFHandler<2>::raw_face_iterator hpDoFHandler<2>::end_face () const;
+template <> hpDoFHandler<2>::raw_face_iterator hpDoFHandler<2>::last_raw_face () const;
+template <> hpDoFHandler<2>::raw_face_iterator hpDoFHandler<2>::last_raw_face (const unsigned int level) const;
+template <> hpDoFHandler<2>::face_iterator hpDoFHandler<2>::last_face () const;
+template <> hpDoFHandler<2>::face_iterator hpDoFHandler<2>::last_face (const unsigned int level) const;
+template <> hpDoFHandler<2>::active_face_iterator hpDoFHandler<2>::last_active_face () const;
+template <> hpDoFHandler<2>::active_face_iterator hpDoFHandler<2>::last_active_face (const unsigned int level) const;
+template <> hpDoFHandler<2>::raw_hex_iterator hpDoFHandler<2>::begin_raw_hex (const unsigned int) const;
+template <> hpDoFHandler<2>::hex_iterator hpDoFHandler<2>::begin_hex (const unsigned int) const;
+template <> hpDoFHandler<2>::active_hex_iterator hpDoFHandler<2>::begin_active_hex (const unsigned int) const;
+template <> hpDoFHandler<2>::raw_hex_iterator hpDoFHandler<2>::end_hex () const;
+template <> hpDoFHandler<2>::raw_hex_iterator hpDoFHandler<2>::last_raw_hex (const unsigned int) const;
+template <> hpDoFHandler<2>::raw_hex_iterator hpDoFHandler<2>::last_raw_hex () const;
+template <> hpDoFHandler<2>::hex_iterator hpDoFHandler<2>::last_hex (const unsigned int) const;
+template <> hpDoFHandler<2>::hex_iterator hpDoFHandler<2>::last_hex () const;
+template <> hpDoFHandler<2>::active_hex_iterator hpDoFHandler<2>::last_active_hex (const unsigned int) const;
+template <> hpDoFHandler<2>::active_hex_iterator hpDoFHandler<2>::last_active_hex () const;
+template <> hpDoFHandler<3>::raw_cell_iterator hpDoFHandler<3>::begin_raw (const unsigned int level) const;
+template <> hpDoFHandler<3>::cell_iterator hpDoFHandler<3>::begin (const unsigned int level) const;
+template <> hpDoFHandler<3>::active_cell_iterator hpDoFHandler<3>::begin_active (const unsigned int level) const;
+template <> hpDoFHandler<3>::raw_cell_iterator hpDoFHandler<3>::end () const;
+template <> hpDoFHandler<3>::raw_cell_iterator hpDoFHandler<3>::last_raw () const;
+template <> hpDoFHandler<3>::raw_cell_iterator hpDoFHandler<3>::last_raw (const unsigned int level) const;
+template <> hpDoFHandler<3>::cell_iterator hpDoFHandler<3>::last () const;
+template <> hpDoFHandler<3>::cell_iterator hpDoFHandler<3>::last (const unsigned int level) const;
+template <> hpDoFHandler<3>::active_cell_iterator hpDoFHandler<3>::last_active () const;
+template <> hpDoFHandler<3>::active_cell_iterator hpDoFHandler<3>::last_active (const unsigned int level) const;
+template <> hpDoFHandler<3>::raw_face_iterator hpDoFHandler<3>::begin_raw_face (const unsigned int level) const;
+template <> hpDoFHandler<3>::face_iterator hpDoFHandler<3>::begin_face (const unsigned int level) const;
+template <> hpDoFHandler<3>::active_face_iterator hpDoFHandler<3>::begin_active_face (const unsigned int level) const;
+template <> hpDoFHandler<3>::raw_face_iterator hpDoFHandler<3>::end_face () const;
+template <> hpDoFHandler<3>::raw_face_iterator hpDoFHandler<3>::last_raw_face () const;
+template <> hpDoFHandler<3>::raw_face_iterator hpDoFHandler<3>::last_raw_face (const unsigned int level) const;
+template <> hpDoFHandler<3>::face_iterator hpDoFHandler<3>::last_face () const;
+template <> hpDoFHandler<3>::face_iterator hpDoFHandler<3>::last_face (const unsigned int level) const;
+template <> hpDoFHandler<3>::active_face_iterator hpDoFHandler<3>::last_active_face () const;
+template <> hpDoFHandler<3>::active_face_iterator hpDoFHandler<3>::last_active_face (const unsigned int level) const;
+
+template <>
+unsigned int hpDoFHandler<1>::distribute_dofs_on_cell (active_cell_iterator &cell,
+ unsigned int next_free_dof);
+template <>
+unsigned int hpDoFHandler<2>::distribute_dofs_on_cell (active_cell_iterator &cell,
+ unsigned int next_free_dof);
+template <>
+unsigned int hpDoFHandler<3>::distribute_dofs_on_cell (active_cell_iterator &cell,
+ unsigned int next_free_dof);
+template <> void hpDoFHandler<1>::renumber_dofs (const std::vector<unsigned int> &new_numbers);
+template <> void hpDoFHandler<2>::renumber_dofs (const std::vector<unsigned int> &new_numbers);
+template <> void hpDoFHandler<3>::renumber_dofs (const std::vector<unsigned int> &new_numbers);
+template <> void hpDoFHandler<1>::reserve_space ();
+template <> void hpDoFHandler<2>::reserve_space ();
+template <> void hpDoFHandler<3>::reserve_space ();
+
+/* ----------------------- Inline functions ---------------------------------- */
+
+template <int dim>
+inline
+unsigned int
+hpDoFHandler<dim>::n_dofs () const
+{
+ return used_dofs;
+}
+
+
+
+template <int dim>
+inline
+const FECollection<dim> &
+hpDoFHandler<dim>::get_fe () const
+{
+ return *finite_elements;
+}
+
+
+template <int dim>
+inline
+const Triangulation<dim> &
+hpDoFHandler<dim>::get_tria () const
+{
+ return *tria;
+}
+
+
+/*---------------------------- dof.h ---------------------------*/
+
+#endif
+/*---------------------------- dof.h ---------------------------*/
--- /dev/null
+//---------------------------- hp_dof_levels.h ------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2003 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- hp_dof_levels.h ------------------------
+#ifndef __deal2__hp_dof_levels_h
+#define __deal2__hp_dof_levels_h
+
+
+#include <base/config.h>
+#include <vector>
+
+
+/**
+ * Store the indices of the degrees of freedom which are located on
+ * objects of dimension @p N. Declare this general template
+ * class, but do not actually use it. Rather, only specializations of
+ * this class are used.
+ *
+ * @author Wolfgang Bangerth, 1998, Oliver Kayser-Herold 2003.
+ */
+template <int N>
+class hpDoFLevel
+{
+ private:
+ /**
+ * Make the constructor private
+ * to avoid that someone uses
+ * this class.
+ */
+ hpDoFLevel ();
+};
+
+
+/**
+ * Store all information which belongs to one level of the multilevel hierarchy.
+ *
+ * In @ref{hpDoFLevel<0>} all data is stored which is not
+ * dependent on the dimension, e.g. a field to store the
+ * index referring to the FECollection class.
+ */
+template <>
+class hpDoFLevel<0>
+{
+ public:
+ /**
+ * Indices specifying the finite element
+ * of FECollection to use for the
+ * different cells. The meaning
+ * what a cell is, is dimension specific,
+ * therefore also the length of this
+ * vector depends on the dimension: in
+ * one dimension, the length of this
+ * vector equals the length of the
+ * @p lines vector, in two dimensions
+ * that of the @p quads vector, etc.
+ */
+
+ std::vector<unsigned int> active_fe_indices;
+};
+
+
+/**
+ * Store the indices of the degrees of freedom which are located on
+ * the lines.
+ *
+ * @sect3{Information for all hpDoFLevel() classes}
+ *
+ * The hpDoFLevel()<tt><N></tt> classes
+ * store the global indices of the degrees of freedom for each cell on a
+ * certain level. The index or number of a degree of freedom is the zero-based
+ * index of the according value in the solution vector and the row and column
+ * index in the global matrix or the multigrid matrix for this level. These
+ * indices refer to the unconstrained vectors and matrices, where we have not
+ * taken account of the constraints introduced by hanging nodes. If more than
+ * one value corresponds to one basis function, for example for vector equations
+ * where the solution is vector valued and thus has several degrees of freedom
+ * for each basis function, we nonetheless store only one index. This can then
+ * be viewed as the index into a block vector, where each block contains the
+ * different values according to a degree of freedom. It is left to the derived
+ * classes, whether the values in a block are stored consecutively or distributed
+ * (e.g. if the solution function is $u=(u_1, u_2)$, we could store the values
+ * in the solution vector like
+ * $\ldots, u_1^m, u_2^m, u_1^{m+1}, u_2^{m+1},\ldots$ with $m$ denoting the
+ * $m$th basis function, or $\ldots, u_1^m, u_1^{m+1}, u_1^{m+2}, \ldots,
+ * u_2^m, u_2^{m+1}, u_2^{m+2}, \ldots$, respectively). Likewise, the
+ * constraint matrix returned by DoFHandler<tt>::make_hanging_node_constraints ()</tt>
+ * is then
+ * to be understood as a block matrix.
+ *
+ * The storage format of the degrees of freedom indices (short: DoF
+ * indices) is somewhat like a mirror of the data structures of the
+ * triangulation classes. There is a hierarchy of
+ * hpDoFLevel()<tt><dim></tt> classes for the different dimensions which
+ * have objects named @p line_dofs, @p quad_dofs and so on, in which
+ * the indices of DoFs located on lines and quads, respectively, are
+ * stored. The indices are stored levelwise.
+ *
+ * Due to the fact that different elements could have a different number
+ * of DoFs on each line, the DoFs on each line are stored in a nested data
+ * structure. @p dof_line_index_offset is used to find the start of the
+ * DoFs indices inside @p line_dofs. Hence the retrieval of DoF indices
+ * for a specific line @p i is a two step process:
+ * 1. Determine the index @p j in @p line_dofs, as the @p ith element of
+ * @p dof_line_index_offset
+ * 2. Get the DoF indices starting from the @p jth element in @p line_dofs.
+ *
+ * The DoF indices for vertices are not stored this way, since they
+ * need different treatment in multigrid environments. If no multigrid
+ * is used, the indices are stored in the @p vertex_dofs array of the
+ * DoFHandler class.
+ *
+ * @author Wolfgang Bangerth, 1998, Oliver Kayser-Herold 2003.
+ */
+template <>
+class hpDoFLevel<1> : public hpDoFLevel<0>
+{
+ public:
+
+ /**
+ * Store the start index for
+ * the degrees of freedom of each
+ * line in the @p line_dofs array.
+ */
+ std::vector<unsigned int> dof_line_index_offset;
+
+ /**
+ * Store the global indices of
+ * the degrees of freedom. See
+ * hpDoFLevel() for detailed
+ * information.
+ */
+ std::vector<unsigned int> line_dofs;
+
+ /**
+ * Determine an estimate for the
+ * memory consumption (in bytes)
+ * of this object.
+ */
+ unsigned int memory_consumption () const;
+};
+
+
+/**
+ * Store the indices of the degrees of freedom which are located on
+ * quads. See @ref{hpDoFLevel<1>} for more information.
+ *
+ * @author Wolfgang Bangerth, 1998, Oliver Kayser-Herold 2003.
+ */
+template <>
+class hpDoFLevel<2> : public hpDoFLevel<1>
+{
+ public:
+
+ /**
+ * Store the start index for
+ * the degrees of freedom of each
+ * quad in the @p quad_dofs array.
+ */
+ std::vector<unsigned int> dof_quad_index_offset;
+
+ /**
+ * Store the global indices of
+ * the degrees of freedom. See
+ * hpDoFLevel() for detailed
+ * information.
+ */
+ std::vector<unsigned int> quad_dofs;
+
+ /**
+ * Determine an estimate for the
+ * memory consumption (in bytes)
+ * of this object.
+ */
+ unsigned int memory_consumption () const;
+};
+
+
+
+/**
+ * Store the indices of the degrees of freedom which are located on
+ * hexhedra. See @ref{hpDoFLevel<1>} for more information.
+ *
+ * @author Wolfgang Bangerth, 1998, Oliver Kayser-Herold 2003.
+ */
+template <>
+class hpDoFLevel<3> : public hpDoFLevel<2>
+{
+ public:
+
+ /**
+ * Store the start index for
+ * the degrees of freedom of each
+ * hex in the @p hex_dofs array.
+ */
+ std::vector<unsigned int> dof_hex_index_offset;
+
+ /**
+ * Store the global indices of
+ * the degrees of freedom. See
+ * hpDoFLevel() for detailed
+ * information.
+ */
+ std::vector<unsigned int> hex_dofs;
+
+ /**
+ * Determine an estimate for the
+ * memory consumption (in bytes)
+ * of this object.
+ */
+ unsigned int memory_consumption () const;
+};
+
+
+#endif
--- /dev/null
+//---------------------------- fe_collection.h ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2003, 2004 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- fe_collection.h ---------------------------
+#ifndef __deal2__fe_collection_h
+#define __deal2__fe_collection_h
+
+#include <base/config.h>
+#include <base/subscriptor.h>
+#include <fe/fe.h>
+
+
+/**
+ * This class acts as a collection of finite element objects used in the
+ * hpDoFHandler(). It is thus to a hpDoFHandler() what a
+ * FiniteElement is to a DoFHandler. This collection stores copies
+ * of the original elements added to it, and is therefore handling its memory
+ * manegement itself.
+ *
+ * In addition to offering access to the elements of the collection, this
+ * class provides access to the maximal number of degrees of freedom per
+ * vertex, line, etc, to allow allocation of as much memory as is necessary in
+ * the worst case when using the finite elements associated with the cells of
+ * a triangulation.
+ *
+ * @author Wolfgang Bangerth, 2003
+ */
+template <int dim>
+class FECollection : public Subscriptor
+{
+ public:
+ /**
+ * Destructor. Destroy the elements of
+ * the collection.
+ */
+ ~FECollection ();
+
+ /**
+ * Add a finite element. This function
+ * generates a copy of the given element,
+ * i.e. you can do things like
+ * <tt>add_fe(FE_Q<dim>(1));</tt>. The
+ * internal copy is later destroyed by
+ * this object upon destruction of the
+ * entire collection.
+ *
+ * The returned value is the new number
+ * of finite elements in the collection.
+ *
+ * When a new element is added, it needs
+ * to have the same number of vector
+ * components as all other elements
+ * already in the collection.
+ */
+ unsigned int
+ add_fe (const FiniteElement<dim> &new_fe);
+
+ /**
+ * Get a reference to the given element
+ * in this collection.
+ */
+ const FiniteElement<dim> &
+ get_fe (const unsigned int index) const;
+
+ /**
+ * Return the number of finite element
+ * objects stored in this collection.
+ */
+ unsigned int n_finite_elements () const;
+
+ /**
+ * Return the number of vector components
+ * of the finite elements in this
+ * collection. This number must be the
+ * same for all elements in the
+ * collection.
+ */
+ unsigned int n_components () const;
+
+ /**
+ * Return the maximal number of degrees
+ * of freedom per vertex over all
+ * elements of this collection.
+ */
+ unsigned int max_dofs_per_vertex () const;
+
+ /**
+ * Return the maximal number of degrees
+ * of freedom per line over all elements
+ * of this collection.
+ */
+ unsigned int max_dofs_per_line () const;
+
+ /**
+ * Return the maximal number of degrees
+ * of freedom per quad over all elements
+ * of this collection.
+ */
+ unsigned int max_dofs_per_quad () const;
+
+ /**
+ * Return the maximal number of degrees
+ * of freedom per hex over all elements
+ * of this collection.
+ */
+ unsigned int max_dofs_per_hex () const;
+
+ /**
+ * Return the maximal number of degrees
+ * of freedom per face over all elements
+ * of this collection.
+ */
+ unsigned int max_dofs_per_face () const;
+
+ /**
+ * Return the maximal number of degrees
+ * of freedom per cell over all elements
+ * of this collection.
+ */
+ unsigned int max_dofs_per_cell () const;
+
+ /**
+ * Return an estimate for the memory
+ * allocated for this object.
+ */
+ unsigned int memory_consumption () const;
+
+ /**
+ * Exception
+ */
+ DeclException0 (ExcNoFiniteElements);
+
+ private:
+ /**
+ * Array of pointers to the finite
+ * elements stored by this collection.
+ */
+ std::vector<SmartPointer<const FiniteElement<dim> > > finite_elements;
+};
+
+
+
+/* --------------- inline functions ------------------- */
+
+template <int dim>
+inline
+unsigned int
+FECollection<dim>::n_finite_elements () const
+{
+ return finite_elements.size();
+}
+
+
+template <int dim>
+inline
+unsigned int
+FECollection<dim>::n_components () const
+{
+ Assert (finite_elements.size () > 0, ExcNoFiniteElements());
+ return finite_elements[0]->n_components ();
+}
+
+
+template <int dim>
+inline
+const FiniteElement<dim> &
+FECollection<dim>::get_fe (const unsigned int index) const
+{
+ Assert (index < finite_elements.size(),
+ ExcIndexRange (index, 0, finite_elements.size()));
+ return *finite_elements[index];
+}
+
+
+
+template <int dim>
+unsigned int
+FECollection<dim>::max_dofs_per_vertex () const
+{
+ Assert (finite_elements.size() > 0, ExcNoFiniteElements());
+
+ unsigned int max = 0;
+ for (unsigned int i=0; i<finite_elements.size(); ++i)
+ if (finite_elements[i]->dofs_per_vertex > max)
+ max = finite_elements[i]->dofs_per_vertex;
+
+ return max;
+}
+
+
+
+template <int dim>
+unsigned int
+FECollection<dim>::max_dofs_per_line () const
+{
+ Assert (finite_elements.size() > 0, ExcNoFiniteElements());
+
+ unsigned int max = 0;
+ for (unsigned int i=0; i<finite_elements.size(); ++i)
+ if (finite_elements[i]->dofs_per_line > max)
+ max = finite_elements[i]->dofs_per_line;
+
+ return max;
+}
+
+
+
+template <int dim>
+unsigned int
+FECollection<dim>::max_dofs_per_quad () const
+{
+ Assert (finite_elements.size() > 0, ExcNoFiniteElements());
+
+ unsigned int max = 0;
+ for (unsigned int i=0; i<finite_elements.size(); ++i)
+ if (finite_elements[i]->dofs_per_quad > max)
+ max = finite_elements[i]->dofs_per_quad;
+
+ return max;
+}
+
+
+
+template <int dim>
+unsigned int
+FECollection<dim>::max_dofs_per_hex () const
+{
+ Assert (finite_elements.size() > 0, ExcNoFiniteElements());
+
+ unsigned int max = 0;
+ for (unsigned int i=0; i<finite_elements.size(); ++i)
+ if (finite_elements[i]->dofs_per_hex > max)
+ max = finite_elements[i]->dofs_per_hex;
+
+ return max;
+}
+
+
+
+template <int dim>
+unsigned int
+FECollection<dim>::max_dofs_per_face () const
+{
+ Assert (finite_elements.size() > 0, ExcNoFiniteElements());
+
+ unsigned int max = 0;
+ for (unsigned int i=0; i<finite_elements.size(); ++i)
+ if (finite_elements[i]->dofs_per_face > max)
+ max = finite_elements[i]->dofs_per_face;
+
+ return max;
+}
+
+
+
+template <int dim>
+unsigned int
+FECollection<dim>::max_dofs_per_cell () const
+{
+ Assert (finite_elements.size() > 0, ExcNoFiniteElements());
+
+ unsigned int max = 0;
+ for (unsigned int i=0; i<finite_elements.size(); ++i)
+ if (finite_elements[i]->dofs_per_cell > max)
+ max = finite_elements[i]->dofs_per_cell;
+
+ return max;
+}
+
+
+#endif
* object.
*/
template <int dim,
+ template <int> class DH1,
+ template <int> class DH2,
class InVector, class OutVector>
static
void
- interpolate (const DoFHandler<dim> &dof1,
- const InVector &u1,
- const DoFHandler<dim> &dof2,
- OutVector &u2);
+ interpolate (const DH1<dim> &dof1,
+ const InVector &u1,
+ const DH2<dim> &dof2,
+ OutVector &u2);
/**
* Gives the interpolation of a
const InVector& u1,
const DoFHandler<dim>& dof2,
const ConstraintMatrix& constraints,
- OutVector& u2);
+ OutVector& u2);
+
+
+ /**
+ * Same as last function, except
+ * that one or both of the dof
+ * handler objects might be of
+ * type @p hpDoFHandler.
+ */
+ template <int dim,
+ template <int> class DH1,
+ template <int> class DH2,
+ class InVector, class OutVector>
+ static void interpolate (const DH1<dim> &dof1,
+ const InVector &u1,
+ const DH2<dim> &dof2,
+ const ConstraintMatrix &constraints,
+ OutVector& u2);
+
/**
* Gives the interpolation of the
*/
template <int dim, class InVector, class OutVector>
static void back_interpolate (const DoFHandler<dim> &dof1,
+ const InVector &u1,
+ const FiniteElement<dim> &fe2,
+ OutVector &u1_interpolated);
+
+ /**
+ * Same as last function, except
+ * that the dof handler objects
+ * might be of type
+ * @p hpDoFHandler.
+ */
+ template <int dim,
+ template <int> class DH,
+ class InVector, class OutVector>
+ static void back_interpolate (const DH<dim> &dof1,
const InVector &u1,
const FiniteElement<dim> &fe2,
OutVector &u1_interpolated);
#include <grid/tria_iterator.h>
#include <dofs/dof_handler.h>
#include <dofs/dof_accessor.h>
+#include <dofs/hp_dof_handler.h>
#include <fe/fe.h>
#include <fe/fe_update_flags.h>
#include <fe/mapping.h>
*/
void reinit (const typename DoFHandler<dim>::cell_iterator &cell);
+ /**
+ * Reinitialize the gradients,
+ * Jacobi determinants, etc for
+ * the given cell of type
+ * "iterator into a hpDoFHandler
+ * object", and the finite
+ * element associated with this
+ * object. It is assumed that the
+ * finite element used by the
+ * given cell is also the one
+ * used by this @p FEValues
+ * object.
+ */
+ void reinit (const typename hpDoFHandler<dim>::cell_iterator &cell);
+
/**
* Reinitialize the gradients,
* Jacobi determinants, etc for
*/
void reinit (const typename DoFHandler<dim>::cell_iterator &cell,
const unsigned int face_no);
-
+
+ /**
+ * Reinitialize the gradients,
+ * Jacobi determinants, etc for
+ * the given cell of type
+ * "iterator into a hpDoFHandler
+ * object", and the finite
+ * element associated with this
+ * object. It is assumed that the
+ * finite element used by the
+ * given cell is also the one
+ * used by this FEValues
+ * object.
+ */
+ void reinit (const typename hpDoFHandler<dim>::cell_iterator &cell,
+ const unsigned int face_no);
+
/**
* Reinitialize the gradients,
* Jacobi determinants, etc for
* object.
*/
void reinit (const typename MGDoFHandler<dim>::cell_iterator &cell,
- const unsigned int face_no);
+ const unsigned int face_no);
/**
* Reinitialize the gradients,
const unsigned int face_no,
const unsigned int subface_no);
- /**
+ /**
+ * Reinitialize the gradients,
+ * Jacobi determinants, etc for
+ * the given cell of type
+ * "iterator into a hpDoFHandler
+ * object", and the finite
+ * element associated with this
+ * object. It is assumed that the
+ * finite element used by the
+ * given cell is also the one
+ * used by this FEValues
+ * object.
+ */
+ void reinit (const typename hpDoFHandler<dim>::cell_iterator &cell,
+ const unsigned int face_no,
+ const unsigned int subface_no);
+
+ /**
* Reinitialize the gradients,
* Jacobi determinants, etc for
* the given cell of type
void reinit (const typename MGDoFHandler<dim>::cell_iterator &cell,
const unsigned int face_no,
const unsigned int subface_no);
-
+
/**
* Reinitialize the gradients,
* Jacobi determinants, etc for
void reinit (const typename Triangulation<dim>::cell_iterator &cell,
const unsigned int face_no,
const unsigned int subface_no);
-
+
/**
* Return a reference to this
* very object.
--- /dev/null
+//---------------------------- hp_fe_values.h ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2003, 2004 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- hp_fe_values.h ---------------------------
+#ifndef __deal2__hp_fe_values_h
+#define __deal2__hp_fe_values_h
+
+#include <base/config.h>
+#include <fe/fe.h>
+#include <fe/fe_collection.h>
+#include <fe/q_collection.h>
+#include <fe/mapping_collection.h>
+#include <fe/fe_values.h>
+
+#include <map>
+#include <boost/shared_ptr.hpp>
+
+template <int dim> class MappingQ1;
+template <int dim> class FiniteElement;
+
+
+namespace internal
+{
+/**
+ * Map between finite element objects and @p FEValues (the second
+ * template parameter, which might be <tt>FEValues<dim></tt>,
+ * <tt>FEFaceValues<dim></tt>, ...) objects. The <tt>hpFE*Values</tt> classes
+ * use this to hold an <tt>FE*Values</tt> object for each finite element
+ * that is used in the triangulation that it integrates on.
+ */
+ template <int dim, class FEValues>
+ class FEValuesMap
+ {
+ public:
+ /**
+ * Make destructor virtual,
+ * since we have virtual
+ * functions in this class.
+ */
+ virtual ~FEValuesMap ();
+
+ /**
+ * Return a reference to the
+ * @p FEValues object selected
+ * by the last call to
+ * @p select_fe_values. The
+ * returned value is a constant
+ * reference since the only
+ * non-const function in the
+ * underlying class would be
+ * @p reinit, which you must
+ * not call directly any way;
+ * rather, use the @p reinit
+ * function of the
+ * <tt>hpFE*Values</tt> class.
+ */
+ const FEValues & get_present_fe_values () const;
+
+ protected:
+ /**
+ * Create an object of type
+ * @p FEValues for this
+ * particular finite
+ * element. Since the type of
+ * @p FEValues is not known
+ * here, we have to leave this
+ * to derived classes.
+ */
+ virtual
+ FEValues * create_fe_values (const FiniteElement<dim> &fe) const = 0;
+
+ /**
+ * Select the @p FEValues
+ * object corresponding to the
+ * finite element object given
+ * as argument. If there is no
+ * such @p FEValues object
+ * yet, then one is created by
+ * calling @p create_fe_values
+ * with this finite element
+ * object.
+ *
+ * A non-const reference to
+ * this object is returned.
+ */
+ FEValues &
+ select_fe_values (const FiniteElement<dim> &fe);
+
+
+ /**
+ * This field remembers the
+ * @p{active_fe_index} of the
+ * cell, which was used for
+ * the last call to @p{reinit}.
+ */
+ unsigned int present_fe_index;
+
+ private:
+ /**
+ * Have a map from pointers to
+ * finite elements to objects
+ * of type @p FEValues.
+ *
+ * Note that the shared pointer
+ * will make sure that the
+ * memory previously allocated
+ * is released when the
+ * destructor of this class is
+ * run.
+ */
+ std::map<SmartPointer<const FiniteElement<dim> >,
+ boost::shared_ptr<FEValues> > fe_to_fe_values_map;
+
+ /**
+ * Pointer to the @p FEValues
+ * object that is used for the
+ * present cell. This always
+ * points to one of the objects
+ * in the map above, and to
+ * which one is determined by
+ * the last call to
+ * @p select_fe_values.
+ */
+ boost::shared_ptr<FEValues> present_fe_values;
+
+ };
+
+
+/**
+ * Base class for the <tt>hpFE*Values</tt> classes, storing the data that
+ * is common to them. The first template parameter denotes the space
+ * dimension we are in, the second the dimensionality of the object
+ * that we integrate on, i.e. for usual @p hpFEValues it is equal to
+ * the first one, while for face integration it is one less.
+ *
+ * @author Wolfgang Bangerth, 2003
+ */
+ template <int dim, int q_dim>
+ class hpFEValuesBase
+ {
+ private:
+ /**
+ * Default mapping, in case
+ * none was provided through
+ * the call to the constructor.
+ */
+ static const MappingQ1<dim> default_mapping;
+
+ public:
+ /**
+ * Constructor. Set the fields
+ * of this class to the values
+ * indicated by the parameters
+ * to the constructor.
+ */
+ hpFEValuesBase (const MappingCollection<dim> &mapping_collection,
+ const QCollection<q_dim> &qcollection,
+ const UpdateFlags update_flags);
+
+
+ /**
+ * Constructor. Set the fields
+ * of this class to the values
+ * indicated by the parameters
+ * to the constructor, and
+ * choose a @p MappingQ1
+ * object for the mapping
+ * object.
+ */
+ hpFEValuesBase (const QCollection<q_dim> &qcollection,
+ const UpdateFlags update_flags);
+
+
+ protected:
+ /**
+ * A copy of the MappingCollection
+ * object, which was specified
+ * upon construction of the
+ * object.
+ */
+ const MappingCollection<dim> mapping_collection;
+
+ /**
+ * Copy of the quadrature
+ * collection object
+ * provided to the
+ * constructor.
+ */
+ const QCollection<q_dim> qcollection;
+
+ /**
+ * Values of the update flags as
+ * given to the constructor.
+ */
+ const UpdateFlags update_flags;
+ };
+}
+
+
+
+template <int dim>
+class hpFEValues : public internal::FEValuesMap<dim,FEValues<dim> >,
+ protected internal::hpFEValuesBase<dim,dim>
+{
+ public:
+ /**
+ * Constructor. Initialize this
+ * object with the given
+ * parameters.
+ *
+ * The finite element
+ * collection parameter is
+ * actually ignored, but is in
+ * the signature of this
+ * function to make it
+ * compatible with the
+ * signature of the respective
+ * constructor of the usual
+ * FEValues object, with
+ * the respective parameter in
+ * that function also being the
+ * return value of the
+ * DoFHandler<tt>::get_fe()</tt>
+ * function.
+ */
+ hpFEValues (const MappingCollection<dim> &mapping_collection,
+ const FECollection<dim> &fe_collection,
+ const QCollection<dim> &qcollection,
+ const UpdateFlags update_flags);
+
+
+ /**
+ * Constructor. Initialize this
+ * object with the given
+ * parameters, and choose a
+ * @p MappingQ1 object for the
+ * mapping object.
+ *
+ * The finite element
+ * collection parameter is
+ * actually ignored, but is in
+ * the signature of this
+ * function to make it
+ * compatible with the
+ * signature of the respective
+ * constructor of the usual
+ * FEValues object, with
+ * the respective parameter in
+ * that function also being the
+ * return value of the
+ * DoFHandler<tt>::get_fe()</tt>
+ * function.
+ */
+ hpFEValues (const FECollection<dim> &fe_collection,
+ const QCollection<dim> &qcollection,
+ const UpdateFlags update_flags);
+
+
+ /**
+ * Reinitialize the object for
+ * the given cell. This selects
+ * the right @p FEValues object
+ * for the finite element in use
+ * by the cell given, and calling
+ * the @p reinit function on
+ * this object.
+ */
+ void
+ reinit (const typename hpDoFHandler<dim>::cell_iterator &cell);
+
+ protected:
+ /**
+ * Create an object of type
+ * @p FEValues for this
+ * particular finite element.
+ */
+ virtual
+ FEValues<dim> *
+ create_fe_values (const FiniteElement<dim> &fe) const;
+};
+
+
+
+template <int dim>
+class hpFEFaceValues : public internal::FEValuesMap<dim,FEFaceValues<dim> >,
+ protected internal::hpFEValuesBase<dim,dim-1>
+{
+ public:
+ /**
+ * Constructor. Initialize this
+ * object with the given
+ * parameters.
+ *
+ * The finite element
+ * collection parameter is
+ * actually ignored, but is in
+ * the signature of this
+ * function to make it
+ * compatible with the
+ * signature of the respective
+ * constructor of the usual
+ * FEValues object, with
+ * the respective parameter in
+ * that function also being the
+ * return value of the
+ * DoFHandler<tt>::get_fe()</tt>
+ * function.
+ */
+ hpFEFaceValues (const MappingCollection<dim> &mapping_collection,
+ const FECollection<dim> &fe_collection,
+ const QCollection<dim-1> &qcollection,
+ const UpdateFlags update_flags);
+
+
+ /**
+ * Constructor. Initialize this
+ * object with the given
+ * parameters, and choose a
+ * @p MappingQ1 object for the
+ * mapping object.
+ *
+ * The finite element
+ * collection parameter is
+ * actually ignored, but is in
+ * the signature of this
+ * function to make it
+ * compatible with the
+ * signature of the respective
+ * constructor of the usual
+ * FEValues object, with
+ * the respective parameter in
+ * that function also being the
+ * return value of the
+ * DoFHandler<tt>::get_fe()</tt>
+ * function.
+ */
+ hpFEFaceValues (const FECollection<dim> &fe_collection,
+ const QCollection<dim-1> &qcollection,
+ const UpdateFlags update_flags);
+
+
+ /**
+ * Reinitialize the object for
+ * the given cell. This selects
+ * the right @p FEValues object
+ * for the finite element in use
+ * by the cell given, and calling
+ * the @p reinit function on
+ * this object.
+ */
+ void
+ reinit (const typename hpDoFHandler<dim>::cell_iterator &cell,
+ const unsigned int face_no);
+
+ protected:
+ /**
+ * Create an object of type
+ * @p FEValues for this
+ * particular finite element.
+ */
+ virtual
+ FEFaceValues<dim> *
+ create_fe_values (const FiniteElement<dim> &fe) const;
+};
+
+
+
+template <int dim>
+class hpFESubfaceValues : public internal::FEValuesMap<dim,FESubfaceValues<dim> >,
+ protected internal::hpFEValuesBase<dim,dim-1>
+{
+ public:
+ /**
+ * Constructor. Initialize this
+ * object with the given
+ * parameters.
+ *
+ * The finite element
+ * collection parameter is
+ * actually ignored, but is in
+ * the signature of this
+ * function to make it
+ * compatible with the
+ * signature of the respective
+ * constructor of the usual
+ * FEValues object, with
+ * the respective parameter in
+ * that function also being the
+ * return value of the
+ * DoFHandler<tt>::get_fe()</tt>
+ * function.
+ */
+ hpFESubfaceValues (const MappingCollection<dim> &mapping_collection,
+ const FECollection<dim> &fe_collection,
+ const QCollection<dim-1> &qcollection,
+ const UpdateFlags update_flags);
+
+
+ /**
+ * Constructor. Initialize this
+ * object with the given
+ * parameters, and choose a
+ * @p MappingQ1 object for the
+ * mapping object.
+ *
+ * The finite element
+ * collection parameter is
+ * actually ignored, but is in
+ * the signature of this
+ * function to make it
+ * compatible with the
+ * signature of the respective
+ * constructor of the usual
+ * FEValues object, with
+ * the respective parameter in
+ * that function also being the
+ * return value of the
+ * DoFHandler<tt>::get_fe()</tt>
+ * function.
+ */
+ hpFESubfaceValues (const FECollection<dim> &fe_collection,
+ const QCollection<dim-1> &qcollection,
+ const UpdateFlags update_flags);
+
+
+ /**
+ * Reinitialize the object for
+ * the given cell. This selects
+ * the right @p FEValues object
+ * for the finite element in use
+ * by the cell given, and calling
+ * the @p reinit function on
+ * this object.
+ */
+ void
+ reinit (const typename hpDoFHandler<dim>::cell_iterator &cell,
+ const unsigned int face_no,
+ const unsigned int subface_no);
+
+ protected:
+ /**
+ * Create an object of type
+ * @p FEValues for this
+ * particular finite element.
+ */
+ virtual
+ FESubfaceValues<dim> *
+ create_fe_values (const FiniteElement<dim> &fe) const;
+};
+
+
+// -------------- inline and template functions --------------
+
+namespace internal
+{
+ template <int dim, class FEValues>
+ inline
+ const FEValues &
+ FEValuesMap<dim,FEValues>::get_present_fe_values () const
+ {
+ return *present_fe_values;
+ }
+}
+
+
+
+
+#endif
--- /dev/null
+//------------------------ mapping_collection.h --------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2005 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//------------------------ mapping_collection.h --------------------------
+#ifndef __deal2__mapping_collection_h
+#define __deal2__mapping_collection_h
+
+#include <base/config.h>
+#include <base/subscriptor.h>
+#include <base/smartpointer.h>
+#include <fe/mapping.h>
+#include <fe/fe.h>
+
+#include <vector>
+#include <boost/shared_ptr.hpp>
+
+
+/**
+ * This class implements a collection of mapping objects used in the
+ * hpDoFHandler(). It is thus to a hpDoFHandler() what a Mapping is to a
+ * DoFHandler. This collection stores pointers to the original mapping
+ * objects added to it. Hence the handling of the memory consumed by
+ * the mapping objects must be done by the user of the class.
+ *
+ * Although it is strongly recommended to supply an appropriate mapping
+ * for each finite element type used in a hp-computation, the MappingCollection
+ * class implements a conversion constructor from a single mapping.
+ * Therefore it is possible to offer only a single mapping to the
+ * hpFEValues class instead of a MappingCollection. This is for the
+ * convenience of the user, as many simple geometries do not require
+ * different mappings along the boundary to achieve optimal convergence rates.
+ * Hence providing a single mapping object will usually suffice.
+ *
+ * @author Oliver Kayser-Herold, 2005
+ */
+template <int dim>
+class MappingCollection : public Subscriptor
+{
+ public:
+ /**
+ * Default constructor. Initialises
+ * this QCollection.
+ */
+ MappingCollection ();
+
+ /**
+ * Conversion constructor. This
+ * constructor creates a MappingCollection
+ * from a single mapping. In
+ * the newly created MappingCollection, this
+ * mapping is used for all active_fe
+ * indices.
+ */
+ MappingCollection (const Mapping<dim> &mapping);
+
+ /**
+ * Returns the number of mapping
+ * objects stored in this container.
+ */
+ unsigned int n_mappings () const;
+
+ /**
+ * Returns the mapping object which
+ * was specified by the user for the
+ * active_fe_index which is provided
+ * as a parameter to this method.
+ */
+ const Mapping<dim> &
+ get_mapping (const unsigned int active_fe_index) const;
+
+ /**
+ * Determine an estimate for the
+ * memory consumption (in bytes)
+ * of this object.
+ */
+ unsigned int memory_consumption () const;
+
+ /**
+ * Adds a new mapping to the MappingCollection.
+ * The mappings have to be added in the order
+ * of the active_fe_indices. Thus the reference
+ * to the mapping object for active_fe_index 0
+ * has to be added first, followed by the
+ * mapping object for active_fe_index 1.
+ */
+ unsigned int add_mapping (const Mapping<dim> &new_mapping);
+
+ private:
+ /**
+ * Upon construction of a <tt>MappingCollection</tt>
+ * the later functionality of the class is specified.
+ * Either it is a real collection, which provides
+ * different mappings for each active_fe_index
+ * or its a "unreal" collection, which returns
+ * a the same mapping for all active_fe_indices.
+ * This boolean remembers which type this object
+ * is.
+ */
+ bool single_mapping;
+
+ /**
+ * The real container, which stores pointers
+ * to the different Mapping objects.
+ */
+ std::vector<SmartPointer<const Mapping<dim> > > mappings;
+};
+
+
+
+/* --------------- inline functions ------------------- */
+
+template <int dim>
+inline
+unsigned int
+MappingCollection<dim>::n_mappings () const
+{
+ return mappings.size();
+}
+
+
+#endif
--- /dev/null
+//---------------------------- q_collection.h ----------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2005 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- q_collection.h ----------------------------
+#ifndef __deal2__q_collection_h
+#define __deal2__q_collection_h
+
+#include <base/config.h>
+#include <base/subscriptor.h>
+#include <base/quadrature.h>
+#include <base/smartpointer.h>
+#include <fe/fe.h>
+
+#include <vector>
+#include <boost/shared_ptr.hpp>
+
+/**
+ * This class implements a collection of quadrature objects used in the
+ * hpDoFHandler(). It is thus to a hpDoFHandler() what a Quadrature is to a
+ * DoFHandler. This collection stores pointers to the original quadrature
+ * elements added to it. Hence the handling of the memory consumed by
+ * the quadrature objects must be done by the user of the class.
+ *
+ * Although it is strongly recommended to supply an appropriate quadrature
+ * for each finite element type used in a hp-computation, the QCollection
+ * class implements a conversion constructor from a single quadrature.
+ * Therefore it is possible to offer only a single quadrature to the
+ * hpFEValues class instead of a QCollection. The reason for this
+ * mechanism lies in the structure of the deal.II library. At many places
+ * throughout the library pseudo quadrature rules are constructed to obtain
+ * the values of the finite element function at certain points. An example
+ * is the DataOut class. Due to this conversion constructor, these lines
+ * of code continue to work without modifications.
+ *
+ * @author Oliver Kayser-Herold, 2005
+ */
+template <int dim>
+class QCollection : public Subscriptor
+{
+ public:
+ /**
+ * Default constructor. Initialises
+ * this QCollection.
+ */
+ QCollection ();
+
+ /**
+ * Conversion constructor. This
+ * constructor creates a QCollection
+ * from a single quadrature rule. In
+ * the newly created QCollection, this
+ * quadrature is used for all active_fe
+ * indices.
+ */
+ QCollection (const Quadrature<dim> &quadrature);
+
+ /**
+ * Returns the number of quadrature
+ * pointers stored in this object.
+ */
+ unsigned int n_quadratures () const;
+
+ /**
+ * Returns a reference to the quadrature rule which
+ * was specified by the user for the
+ * active_fe_index which is provided
+ * as a parameter to this method.
+ */
+ const Quadrature<dim> &
+ get_quadrature (const unsigned int active_fe_index) const;
+
+ /**
+ * Determine an estimate for the
+ * memory consumption (in bytes)
+ * of this object.
+ */
+ unsigned int memory_consumption () const;
+
+ /**
+ * Adds a new quadrature rule to the QCollection.
+ * The quadrature rules have to be added in the order
+ * of the active_fe_indices. Thus the reference
+ * to the quadrature rule for active_fe_index 0
+ * has to be added first, followed by the
+ * quadrature rule for active_fe_index 1.
+ */
+ unsigned int add_quadrature (const Quadrature<dim> &new_quadrature);
+
+ DeclException0 (ExcNoQuadrature);
+
+ private:
+ /**
+ * Upon construction of a <tt>QCollection</tt>
+ * the later functionality of the class is specified.
+ * Either it is a real collection, which provides
+ * different quadrature rules for each active_fe_index
+ * or its a "unreal" collection, which returns
+ * a the same quadrature rule for all active_fe_indices.
+ * This boolean remembers which type this object
+ * is.
+ */
+ bool single_quadrature;
+
+ /**
+ * The real container, which stores pointers
+ * to the different quadrature objects.
+ */
+ std::vector<SmartPointer<const Quadrature<dim> > > quadratures;
+};
+
+
+
+/* --------------- inline functions ------------------- */
+
+template <int dim>
+inline
+unsigned int
+QCollection<dim>::n_quadratures () const
+{
+ return quadratures.size();
+}
+
+
+#endif
--- /dev/null
+//---------------------------- select_fe_values.h ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2003 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- select_fe_values.h ---------------------------
+#ifndef __deal2__select_fe_values_h
+#define __deal2__select_fe_values_h
+
+#include <base/config.h>
+
+template <int> class DoFHandler;
+template <int> class hpDoFHandler;
+
+template <int> class FEValues;
+template <int> class FEFaceValues;
+template <int> class FESubfaceValues;
+
+template <int> class hpFEValues;
+template <int> class hpFEFaceValues;
+template <int> class hpFESubfaceValues;
+
+
+
+template <typename> struct SelectFEValues;
+
+template <int dim> struct SelectFEValues<DoFHandler<dim> >
+{
+ typedef FEValues<dim> FEValues;
+ typedef FEFaceValues<dim> FEFaceValues;
+ typedef FESubfaceValues<dim> FESubfaceValues;
+};
+
+
+template <int dim> struct SelectFEValues<hpDoFHandler<dim> >
+{
+ typedef hpFEValues<dim> FEValues;
+ typedef hpFEFaceValues<dim> FEFaceValues;
+ typedef hpFESubfaceValues<dim> FESubfaceValues;
+};
+
+
+
+
+#endif
* Reset the DoF handler pointer.
*/
void set_mg_dof_handler (MGDoFHandler<dim> *dh) {
- Assert (dh != 0, typename DoFAccessor<dim>::ExcInvalidObject());
+ typedef DoFAccessor<dim, DoFHandler> BaseClass;
+ Assert (dh != 0, typename BaseClass::ExcInvalidObject());
mg_dof_handler = dh;
};
* See the full documentation for
* more information.
*/
- typedef DoFObjectAccessor<celldim,dim> BaseClass;
+ typedef DoFObjectAccessor<celldim,dim,DoFHandler> BaseClass;
};
* See the full documentation for
* more information.
*/
- typedef DoFCellAccessor<dim> BaseClass;
+ typedef DoFCellAccessor<dim, DoFHandler> BaseClass;
};
* A copy of the transferred
* finite element is stored.
*/
- virtual void distribute_dofs (const FiniteElement<dim> &,
+ virtual void distribute_dofs (const FiniteElement<dim> &,
const unsigned int offset = 0);
/**
// by restricting from fine level.
for (; level_cell!=level_end; ++level_cell)
{
- DoFObjectAccessor<dim, dim>& global_cell = *level_cell;
// get the dof numbers of
// this cell for the global
// and the level-wise
// numbering
- global_cell.get_dof_indices(global_dof_indices);
+ level_cell->get_dof_indices(global_dof_indices);
level_cell->get_mg_dof_indices (level_dof_indices);
// transfer the global
// monotonuosly increasing
for (; level_cell != endc; ++level_cell)
{
- DoFObjectAccessor<dim, dim>& global_cell = *level_cell;
const unsigned int level = level_cell->level();
// get the dof numbers of
// this cell for the global
// and the level-wise
// numbering
- global_cell.get_dof_indices (global_dof_indices);
+ level_cell->get_dof_indices (global_dof_indices);
level_cell->get_mg_dof_indices(level_dof_indices);
// copy level-wise data to
// monotonuosly increasing
for (; level_cell != endc; ++level_cell)
{
- DoFObjectAccessor<dim, dim>& global_cell = *level_cell;
const unsigned int level = level_cell->level();
// get the dof numbers of
// this cell for the global
// and the level-wise
// numbering
- global_cell.get_dof_indices (global_dof_indices);
+ level_cell->get_dof_indices (global_dof_indices);
level_cell->get_mg_dof_indices(level_dof_indices);
//TODO:[GK] Probably wrong for continuous elements
// by restricting from fine level.
for (; level_cell!=level_end; ++level_cell)
{
- DoFObjectAccessor<dim, dim>& global_cell = *level_cell;
// get the dof numbers of
// this cell for the global
// and the level-wise
// numbering
- global_cell.get_dof_indices(global_dof_indices);
+ level_cell->get_dof_indices(global_dof_indices);
level_cell->get_mg_dof_indices (level_dof_indices);
// transfer the global
// monotonuosly increasing
for (; level_cell != endc; ++level_cell)
{
- DoFObjectAccessor<dim, dim>& global_cell = *level_cell;
const unsigned int level = level_cell->level();
// get the dof numbers of
// this cell for the global
// and the level-wise
// numbering
- global_cell.get_dof_indices (global_dof_indices);
+ level_cell->get_dof_indices (global_dof_indices);
level_cell->get_mg_dof_indices(level_dof_indices);
// copy level-wise data to
// monotonuosly increasing
for (; level_cell != endc; ++level_cell)
{
- DoFObjectAccessor<dim, dim>& global_cell = *level_cell;
const unsigned int level = level_cell->level();
// get the dof numbers of
// this cell for the global
// and the level-wise
// numbering
- global_cell.get_dof_indices (global_dof_indices);
+ level_cell->get_dof_indices (global_dof_indices);
level_cell->get_mg_dof_indices(level_dof_indices);
//TODO:[GK+WB] Probably wrong for continuous elements
// by restricting from fine level.
for (; level_cell!=level_end; ++level_cell)
{
- DoFObjectAccessor<dim, dim>& global_cell = *level_cell;
// get the dof numbers of
// this cell for the global
// and the level-wise
// numbering
- global_cell.get_dof_indices(global_dof_indices);
+ level_cell->get_dof_indices(global_dof_indices);
level_cell->get_mg_dof_indices (level_dof_indices);
// transfer the global
// increasing
for (; level_cell != endc; ++level_cell)
{
- DoFObjectAccessor<dim, dim>& global_cell = *level_cell;
const unsigned int level = level_cell->level();
// get the dof numbers of
// this cell for the global
// and the level-wise
// numbering
- global_cell.get_dof_indices (global_dof_indices);
+ level_cell->get_dof_indices (global_dof_indices);
level_cell->get_mg_dof_indices(level_dof_indices);
// copy level-wise data to
// increasing
for (; level_cell != endc; ++level_cell)
{
- DoFObjectAccessor<dim, dim>& global_cell = *level_cell;
const unsigned int level = level_cell->level();
// get the dof numbers of
// this cell for the global
// and the level-wise
// numbering
- global_cell.get_dof_indices (global_dof_indices);
+ level_cell->get_dof_indices (global_dof_indices);
level_cell->get_mg_dof_indices(level_dof_indices);
//TODO:[GK] Probably wrong for continuous elements
* @ingroup IO
* @author Wolfgang Bangerth, 1999
*/
-template <int dof_handler_dim, int patch_dim, int patch_space_dim=patch_dim>
+template <int dof_handler_dim, template <int> class DH,
+ int patch_dim, int patch_space_dim=patch_dim>
class DataOut_DoFData : public DataOutInterface<patch_dim,patch_space_dim>
{
+#ifdef DEAL_II_TEMPLATE_TEMPLATE_TYPEDEF_BUG
+ // helper class
+ struct DH_dim : public DH<dof_handler_dim>
+ {
+ // constructor. will
+ // not be implemented,
+ // but suppresses compiler
+ // warning about non-default
+ // constructor of GridClass
+ DH_dim ();
+
+ /**
+ * Declare iterator type, for
+ * access from outside.
+ */
+ typedef typename DH<dof_handler_dim>::cell_iterator cell_iterator;
+ typedef typename DH<dof_handler_dim>::active_cell_iterator active_cell_iterator;
+ };
public:
+
+ /**
+ * Typedef to the iterator type
+ * of the dof handler class under
+ * consideration.
+ */
+ typedef typename DH_dim::cell_iterator cell_iterator;
+ typedef typename DH_dim::active_cell_iterator active_cell_iterator;
+
+#else
+ public:
+
+ /**
+ * Typedef to the iterator type
+ * of the dof handler class under
+ * consideration.
+ */
+ typedef typename DH<dof_handler_dim>::cell_iterator cell_iterator;
+ typedef typename DH<dof_handler_dim>::active_cell_iterator active_cell_iterator;
+#endif
+ public:
+
/**
* Type describing what the
* vector given to
* and the mapping between nodes
* and node values.
*/
- void attach_dof_handler (const DoFHandler<dof_handler_dim> &);
+ void attach_dof_handler (const DH<dof_handler_dim> &);
/**
* Add a data vector together
* patches.
*/
template <int dof_handler_dim2>
- void merge_patches (const DataOut_DoFData<dof_handler_dim2,patch_dim,patch_space_dim> &source,
+ void merge_patches (const DataOut_DoFData<dof_handler_dim2,DH,patch_dim,patch_space_dim> &source,
const Point<patch_space_dim> &shift = Point<patch_space_dim>());
/**
/**
* Pointer to the dof handler object.
*/
- SmartPointer<const DoFHandler<dof_handler_dim> > dofs;
+ SmartPointer<const DH<dof_handler_dim> > dofs;
/**
* List of data elements with vectors of
* friends. Needed for the
* merge_patches() function.
*/
- template <int,int,int> friend class DataOut_DoFData;
+ template <int,template <int> class, int,int>
+ friend class DataOut_DoFData;
#ifdef DEAL_II_NESTED_CLASS_FRIEND_BUG
/**
# ifdef DEAL_II_NESTED_CLASS_TEMPL_FRIEND_BUG
template <typename> friend class DataEntry;
# else
- template <int N1, int N2, int N3>
+ template <int N1, template <int> class DH, int N2, int N3>
template <typename>
- friend class DataOut_DoFData<N1,N2,N3>::DataEntry;
+ friend class DataOut_DoFData<N1,DH,N2,N3>::DataEntry;
# endif
#endif
};
* @ingroup IO
* @author Wolfgang Bangerth, 1999
*/
-template <int dim>
-class DataOut : public DataOut_DoFData<dim,dim>
+template <int dim, template <int> class DH = DoFHandler>
+class DataOut : public DataOut_DoFData<dim,DH,dim>
{
public:
+ /**
+ * Typedef to the iterator type
+ * of the dof handler class under
+ * consideration.
+ */
+ typedef typename DataOut_DoFData<dim,DH,dim>::cell_iterator cell_iterator;
+ typedef typename DataOut_DoFData<dim,DH,dim>::active_cell_iterator active_cell_iterator;
+
/**
* This is the central function
* of this class since it builds
* might want to return other
* cells in a derived class.
*/
- virtual typename DoFHandler<dim>::cell_iterator
- first_cell ();
+ virtual cell_iterator first_cell ();
/**
* Return the next cell after
* only one of the two functions
* might not be a good idea.
*/
- virtual typename DoFHandler<dim>::cell_iterator
- next_cell (const typename DoFHandler<dim>::cell_iterator &cell);
+ virtual cell_iterator next_cell (const cell_iterator &cell);
/**
* Exception
// -------------------- template and inline functions ------------------------
-template <int dof_handler_dim, int patch_dim, int patch_space_dim>
+template <int dof_handler_dim, template <int> class DH,
+ int patch_dim, int patch_space_dim>
template <int dof_handler_dim2>
void
-DataOut_DoFData<dof_handler_dim,patch_dim,patch_space_dim>::
-merge_patches (const DataOut_DoFData<dof_handler_dim2,patch_dim,patch_space_dim> &source,
+DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::
+merge_patches (const DataOut_DoFData<dof_handler_dim2,DH,patch_dim,patch_space_dim> &source,
const Point<patch_space_dim> &shift)
{
const std::vector<Patch> source_patches = source.get_patches ();
* @ingroup IO
* @author Wolfgang Bangerth, 2000
*/
-template <int dim>
-class DataOutFaces : public DataOut_DoFData<dim,dim-1,dim>
+template <int dim, template <int> class DH = DoFHandler>
+class DataOutFaces : public DataOut_DoFData<dim,DH,dim-1,dim>
{
public:
- /**
+ /**
+ * Typedef to the iterator type
+ * of the dof handler class under
+ * consideration.
+ */
+ typedef typename DataOut_DoFData<dim,DH,dim-1,dim>::cell_iterator cell_iterator;
+
+ /**
* This is the central function
* of this class since it builds
* the list of patches to be
* aliased to a name that is
* better to type.
*/
- typedef typename std::pair<typename DoFHandler<dim>::cell_iterator,unsigned int> FaceDescriptor;
+ typedef typename std::pair<cell_iterator,unsigned int> FaceDescriptor;
/**
* @ingroup IO
* @author Wolfgang Bangerth, 2000
*/
-template <int dim>
-class DataOutRotation : public DataOut_DoFData<dim,dim+1>
+template <int dim, template <int> class DH = DoFHandler>
+class DataOutRotation : public DataOut_DoFData<dim,DH,dim+1>
{
public:
- /**
+ /**
+ * Typedef to the iterator type
+ * of the dof handler class under
+ * consideration.
+ */
+ typedef typename DataOut_DoFData<dim,DH,dim+1>::cell_iterator cell_iterator;
+
+ /**
* This is the central function
* of this class since it builds
* the list of patches to be
* return other cells in a
* derived class.
*/
- virtual typename DoFHandler<dim>::cell_iterator
- first_cell ();
+ virtual cell_iterator first_cell ();
/**
* Return the next cell after @p cell which
* of the two functions might not be
* a good idea.
*/
- virtual typename DoFHandler<dim>::cell_iterator
- next_cell (const typename DoFHandler<dim>::cell_iterator &cell);
+ virtual cell_iterator next_cell (const cell_iterator &cell);
/**
* Exception
/* -------------- declaration of explicit specializations ------------- */
-template <> void DataOutRotation<3>::build_some_patches (Data);
+template <> void DataOutRotation<3,DoFHandler>::build_some_patches (Data);
#endif
* @ingroup IO
* @author Wolfgang Bangerth, 1999
*/
-template <int dim>
+template <int dim, template <int> class DH = DoFHandler>
class DataOutStack : public DataOutInterface<dim+1>
{
public:
* data vectors for the present
* parameter value.
*/
- void attach_dof_handler (const DoFHandler<dim> &dof_handler);
+ void attach_dof_handler (const DH<dim> &dof_handler);
/**
* Declare a data vector. The @p vector_type
* corresponding to the present parameter
* value.
*/
- SmartPointer<const DoFHandler<dim> > dof_handler;
+ SmartPointer<const DH<dim> > dof_handler;
/**
* List of patches of all past and
#include <base/config.h>
#include <base/exceptions.h>
-#include <dofs/dof_handler.h>
#include <fe/fe_update_flags.h>
#include <fe/mapping.h>
#include <utility>
+template <int dim> class DoFHandler;
+template <int dim> class hpDoFHandler;
+
/**
* number of vector components can be
* given here.
*/
- template <int dim, class InputVector>
+ template <int dim, template <int> class DH, class InputVector>
static void
approximate_gradient (const Mapping<dim> &mapping,
- const DoFHandler<dim> &dof,
+ const DH<dim> &dof,
const InputVector &solution,
Vector<float> &derivative_norm,
const unsigned int component = 0);
* function, see above, with
* <tt>mapping=MappingQ1@<dim@>()</tt>.
*/
- template <int dim, class InputVector>
+ template <int dim, template <int> class DH, class InputVector>
static void
- approximate_gradient (const DoFHandler<dim> &dof,
+ approximate_gradient (const DH<dim> &dof,
const InputVector &solution,
Vector<float> &derivative_norm,
const unsigned int component = 0);
* number of vector components can be
* given here.
*/
- template <int dim, class InputVector>
+ template <int dim, template <int> class DH, class InputVector>
static void
approximate_second_derivative (const Mapping<dim> &mapping,
- const DoFHandler<dim> &dof,
+ const DH<dim> &dof,
const InputVector &solution,
Vector<float> &derivative_norm,
const unsigned int component = 0);
* function, see above, with
* <tt>mapping=MappingQ1@<dim@>()</tt>.
*/
- template <int dim, class InputVector>
+ template <int dim, template <int> class DH, class InputVector>
static void
- approximate_second_derivative (const DoFHandler<dim> &dof,
+ approximate_second_derivative (const DH<dim> &dof,
const InputVector &solution,
Vector<float> &derivative_norm,
const unsigned int component = 0);
* solution vector we are to work
* on.
*/
- template <class DerivativeDescription, int dim, class InputVector>
+ template <class DerivativeDescription, int dim,
+ template <int> class DH, class InputVector>
static void
approximate_derivative (const Mapping<dim> &mapping,
- const DoFHandler<dim> &dof,
+ const DH<dim> &dof,
const InputVector &solution,
const unsigned int component,
Vector<float> &derivative_norm);
* the range given by the third
* parameter.
*/
- template <class DerivativeDescription, int dim, class InputVector>
+ template <class DerivativeDescription, int dim,
+ template <int> class DH, class InputVector>
static void
approximate (const Mapping<dim> &mapping,
- const DoFHandler<dim> &dof,
+ const DH<dim> &dof,
const InputVector &solution,
const unsigned int component,
const IndexInterval &index_interval,
/* -------------- declaration of explicit specializations ------------- */
-template <> double DerivativeApproximation::SecondDerivative<1>::derivative_norm (
- const Derivative &d);
-template <> double DerivativeApproximation::SecondDerivative<2>::derivative_norm (
- const Derivative &d);
-template <> double DerivativeApproximation::SecondDerivative<3>::derivative_norm (
- const Derivative &d);
+template <>
+double
+DerivativeApproximation::SecondDerivative<1>::derivative_norm (const Derivative &d);
+
+template <>
+double
+DerivativeApproximation::SecondDerivative<2>::derivative_norm (const Derivative &d);
+
+template <>
+double
+DerivativeApproximation::SecondDerivative<3>::derivative_norm (const Derivative &d);
#endif
template <typename number> class FullMatrix;
template <int dim> class Mapping;
template <int dim> class DoFHandler;
+template <int dim> class hpDoFHandler;
class ConstraintMatrix;
* See the general doc for more
* information.
*/
- template <int dim>
- static void interpolate_boundary_values (const Mapping<dim> &mapping,
- const DoFHandler<dim> &dof,
- const typename FunctionMap<dim>::type &function_map,
- std::map<unsigned int,double> &boundary_values,
- const std::vector<bool> &component_mask = std::vector<bool>());
+ template <int dim, template <int> class DH>
+ static
+ void
+ interpolate_boundary_values (const Mapping<dim> &mapping,
+ const DH<dim> &dof,
+ const typename FunctionMap<dim>::type &function_map,
+ std::map<unsigned int,double> &boundary_values,
+ const std::vector<bool> &component_mask = std::vector<bool>());
/**
* Declaration of specialization
* of the previous function for
- * 1d.
+ * 1d and a DoFHandler.
+ */
+ static
+ void
+ interpolate_boundary_values (const Mapping<1> &mapping,
+ const DoFHandler<1> &dof,
+ const FunctionMap<1>::type &function_map,
+ std::map<unsigned int,double> &boundary_values,
+ const std::vector<bool> &component_mask = std::vector<bool>());
+
+ /**
+ * Declaration of specialization
+ * of the previous function for
+ * 1d and a hpDoFHandler().
*/
- static void interpolate_boundary_values (const Mapping<1> &mapping,
- const DoFHandler<1> &dof,
- const FunctionMap<1>::type &function_map,
- std::map<unsigned int,double> &boundary_values,
- const std::vector<bool> &component_mask = std::vector<bool>());
+ static
+ void
+ interpolate_boundary_values (const Mapping<1> &mapping,
+ const hpDoFHandler<1> &dof,
+ const FunctionMap<1>::type &function_map,
+ std::map<unsigned int,double> &boundary_values,
+ const std::vector<bool> &component_mask = std::vector<bool>());
/**
* Same function as above, but
* This function is there mainly
* for backward compatibility.
*/
- template <int dim>
- static void interpolate_boundary_values (const Mapping<dim> &mapping,
- const DoFHandler<dim> &dof,
- const unsigned char boundary_component,
- const Function<dim> &boundary_function,
- std::map<unsigned int,double> &boundary_values,
- const std::vector<bool> &component_mask = std::vector<bool>());
+ template <int dim, template <int> class DH>
+ static
+ void
+ interpolate_boundary_values (const Mapping<dim> &mapping,
+ const DH<dim> &dof,
+ const unsigned char boundary_component,
+ const Function<dim> &boundary_function,
+ std::map<unsigned int,double> &boundary_values,
+ const std::vector<bool> &component_mask = std::vector<bool>());
/**
* Declaration of specialization
* of the previous function for
* 1d.
*/
- static void interpolate_boundary_values (const Mapping<1> &mapping,
- const DoFHandler<1> &dof,
- const unsigned char boundary_component,
- const Function<1> &boundary_function,
- std::map<unsigned int,double> &boundary_values,
- const std::vector<bool> &component_mask = std::vector<bool>());
+ template <template <int> class DH>
+ static
+ void
+ interpolate_boundary_values (const Mapping<1> &mapping,
+ const DH<1> &dof,
+ const unsigned char boundary_component,
+ const Function<1> &boundary_function,
+ std::map<unsigned int,double> &boundary_values,
+ const std::vector<bool> &component_mask = std::vector<bool>());
+
/**
* Calls the other
* @p interpolate_boundary_values
* function, see above, with
* <tt>mapping=MappingQ1@<dim@>()</tt>.
*/
- template <int dim>
- static void interpolate_boundary_values (const DoFHandler<dim> &dof,
- const unsigned char boundary_component,
- const Function<dim> &boundary_function,
- std::map<unsigned int,double> &boundary_values,
- const std::vector<bool> &component_mask = std::vector<bool>());
+ template <int dim, template <int> class DH>
+ static
+ void
+ interpolate_boundary_values (const DH<dim> &dof,
+ const unsigned char boundary_component,
+ const Function<dim> &boundary_function,
+ std::map<unsigned int,double> &boundary_values,
+ const std::vector<bool> &component_mask = std::vector<bool>());
+
/**
* Calls the other
* @p interpolate_boundary_values
* function, see above, with
* <tt>mapping=MappingQ1@<dim@>()</tt>.
*/
- template <int dim>
- static void interpolate_boundary_values (const DoFHandler<dim> &dof,
- const typename FunctionMap<dim>::type &function_map,
- std::map<unsigned int,double> &boundary_values,
- const std::vector<bool> &component_mask = std::vector<bool>());
-
-
+ template <int dim, template <int> class DH>
+ static
+ void
+ interpolate_boundary_values (const DH<dim> &dof,
+ const typename FunctionMap<dim>::type &function_map,
+ std::map<unsigned int,double> &boundary_values,
+ const std::vector<bool> &component_mask = std::vector<bool>());
+
+
/**
* Project @p function to the boundary
* of the domain, using the given quadrature
#if deal_II_dimension == 1
+//TODO[?] Actually the Mapping object should be a MappingCollection object for the
+// hpDoFHandler.
+template <template <int> class DH>
void
VectorTools::interpolate_boundary_values (const Mapping<1> &,
- const DoFHandler<1> &dof,
+ const DH<1> &dof,
const unsigned char boundary_component,
const Function<1> &boundary_function,
std::map<unsigned int,double> &boundary_values,
Assert (boundary_component != 255,
ExcInvalidBoundaryIndicator());
- const FiniteElement<1> &fe = dof.get_fe();
- Assert (fe.n_components() == boundary_function.n_components,
- ExcComponentMismatch());
-
- // set the component mask to either
- // the original value or a vector
- // of @p{true}s
- const std::vector<bool> component_mask ((component_mask_.size() == 0) ?
- std::vector<bool> (fe.n_components(), true) :
- component_mask_);
- Assert (std::count(component_mask.begin(), component_mask.end(), true) > 0,
- ExcComponentMismatch());
-
// check whether boundary values at
// the left or right boundary of
// the line are
// cell by first traversing the coarse
// grid to its end and then going
// to the children
- DoFHandler<1>::cell_iterator outermost_cell = dof.begin(0);
+ typename DH<1>::cell_iterator outermost_cell = dof.begin(0);
while (outermost_cell->neighbor(direction).state() == IteratorState::valid)
outermost_cell = outermost_cell->neighbor(direction);
while (outermost_cell->has_children())
outermost_cell = outermost_cell->child(direction);
+ // get the FE corresponding to this
+ // cell
+ const FiniteElement<1> &fe = outermost_cell->get_fe();
+ Assert (fe.n_components() == boundary_function.n_components,
+ ExcComponentMismatch());
+
+ // set the component mask to either
+ // the original value or a vector
+ // of @p{true}s
+ const std::vector<bool> component_mask ((component_mask_.size() == 0) ?
+ std::vector<bool> (fe.n_components(), true) :
+ component_mask_);
+ Assert (std::count(component_mask.begin(), component_mask.end(), true) > 0,
+ ExcComponentMismatch());
+
// now set the value of the
// outermost degree of
// freedom. setting also
}
-
+//TODO[?] Actually the Mapping object should be a MappingCollection object for the
+// hpDoFHandler.
void
VectorTools::interpolate_boundary_values (const Mapping<1> &mapping,
const DoFHandler<1> &dof,
}
+//TODO[?] Actually the Mapping object should be a MappingCollection object for the
+// hpDoFHandler.
+void
+VectorTools::interpolate_boundary_values (const Mapping<1> &mapping,
+ const hpDoFHandler<1> &dof,
+ const FunctionMap<1>::type &function_map,
+ std::map<unsigned int,double> &boundary_values,
+ const std::vector<bool> &component_mask)
+{
+ for (FunctionMap<1>::type::const_iterator i=function_map.begin();
+ i!=function_map.end(); ++i)
+ interpolate_boundary_values (mapping, dof, i->first, *i->second,
+ boundary_values, component_mask);
+}
+
+
#endif
-template <int dim>
+template <int dim, template <int> class DH>
void
VectorTools::
interpolate_boundary_values (const Mapping<dim> &mapping,
- const DoFHandler<dim> &dof,
+ const DH<dim> &dof,
const typename FunctionMap<dim>::type &function_map,
std::map<unsigned int,double> &boundary_values,
const std::vector<bool> &component_mask_)
Assert (function_map.find(255) == function_map.end(),
ExcInvalidBoundaryIndicator());
- const FiniteElement<dim> &fe = dof.get_fe();
- const unsigned int n_components = fe.n_components();
+ const unsigned int n_components = get_n_components(dof);
const bool fe_is_system = (n_components != 1);
for (typename FunctionMap<dim>::type::const_iterator i=function_map.begin();
// the original value or a vector
// of @p{true}s
const std::vector<bool> component_mask ((component_mask_.size() == 0) ?
- std::vector<bool> (fe.n_components(), true) :
+ std::vector<bool> (n_components, true) :
component_mask_);
Assert (std::count(component_mask.begin(), component_mask.end(), true) > 0,
ExcComponentMismatch());
// field to store the indices
- std::vector<unsigned int> face_dofs (fe.dofs_per_face,
- DoFHandler<dim>::invalid_dof_index);
- std::vector<Point<dim> > dof_locations (face_dofs.size(), Point<dim>());
-
+ std::vector<unsigned int> face_dofs;
+ face_dofs.reserve (max_dofs_per_face(dof));
+ std::fill (face_dofs.begin (), face_dofs.end (), DoFHandler<dim>::invalid_dof_index);
+
+ std::vector<Point<dim> > dof_locations;
+ dof_locations.reserve (max_dofs_per_face(dof));
+ std::fill (dof_locations.begin(), dof_locations.end (), Point<dim>());
+
// array to store the values of
// the boundary function at the
// boundary points. have to arrays
// for scalar and vector functions
// to use the more efficient one
// respectively
- std::vector<double> dof_values_scalar (fe.dofs_per_face);
- std::vector<Vector<double> > dof_values_system (fe.dofs_per_face,
- Vector<double>(fe.n_components()));
+ std::vector<double> dof_values_scalar;
+ std::vector<Vector<double> > dof_values_system;
+ dof_values_scalar.reserve (max_dofs_per_face (dof));
+ dof_values_system.reserve (max_dofs_per_face (dof));
- // next generate a quadrature rule
- // on the face from the unit
- // support points. this wil be used
- // to obtain the quadrature points
- // on the real cell's face
- std::vector<Point<dim-1> >
- unit_support_points = fe.get_unit_face_support_points();
-
- // check whether there are support
- // points on the face. if not, then
- // we should try a more clever
- // way. the idea is that a finite
- // element may not offer support
- // points for all its shape
- // functions, but maybe only
- // some. if it offers support
- // points for the components we are
- // interested in in this function,
- // then that's fine. if not, the
- // function we call in the finite
- // element will raise an
- // exception. the support points
- // for the other shape functions
- // are left uninitialized (well,
- // initialized by the default
- // constructor), since we don't
- // need them anyway.
- if (unit_support_points.size() == 0)
- {
- unit_support_points.resize (fe.dofs_per_face);
- for (unsigned int i=0; i<fe.dofs_per_face; ++i)
- if (component_mask[fe.face_system_to_component_index(i).first]
- == true)
- unit_support_points[i] = fe.unit_face_support_point(i);
- };
-
- Quadrature<dim-1> aux_quad (unit_support_points);
- FEFaceValues<dim> fe_values (mapping, fe, aux_quad, update_q_points);
-
- typename DoFHandler<dim>::active_cell_iterator cell = dof.begin_active(),
- endc = dof.end();
+ typename DH<dim>::active_cell_iterator cell = dof.begin_active(),
+ endc = dof.end();
for (; cell!=endc; ++cell)
for (unsigned int face_no = 0; face_no < GeometryInfo<dim>::faces_per_cell;
++face_no)
{
- typename DoFHandler<dim>::face_iterator face = cell->face(face_no);
+ const FiniteElement<dim> &fe = cell->get_fe();
+
+ typename DH<dim>::face_iterator face = cell->face(face_no);
const unsigned char boundary_component = face->boundary_indicator();
if (function_map.find(boundary_component) != function_map.end())
// face is of the right component
{
+//TODO[?] Should work for both DoFHandlers. But probably not the most efficient
+// implementation.
+ // next generate a quadrature rule
+ // on the face from the unit
+ // support points. this wil be used
+ // to obtain the quadrature points
+ // on the real cell's face
+ std::vector<Point<dim-1> >
+ unit_support_points = fe.get_unit_face_support_points();
+
+ // check whether there are support
+ // points on the face. if not, then
+ // we should try a more clever
+ // way. the idea is that a finite
+ // element may not offer support
+ // points for all its shape
+ // functions, but maybe only
+ // some. if it offers support
+ // points for the components we are
+ // interested in in this function,
+ // then that's fine. if not, the
+ // function we call in the finite
+ // element will raise an
+ // exception. the support points
+ // for the other shape functions
+ // are left uninitialized (well,
+ // initialized by the default
+ // constructor), since we don't
+ // need them anyway.
+ if (unit_support_points.size() == 0)
+ {
+ unit_support_points.resize (fe.dofs_per_face);
+ for (unsigned int i=0; i<fe.dofs_per_face; ++i)
+ if (component_mask[fe.face_system_to_component_index(i).first]
+ == true)
+ unit_support_points[i] = fe.unit_face_support_point(i);
+ };
+
+ Quadrature<dim-1> aux_quad (unit_support_points);
+ FEFaceValues<dim> fe_values (mapping, fe, aux_quad, update_q_points);
+//TODO[?] End of inefficient code
+
// get indices, physical location and
// boundary values of dofs on this
// face
+ face_dofs.resize (fe.dofs_per_face);
face->get_dof_indices (face_dofs);
fe_values.reinit(cell, face_no);
- const std::vector<Point<dim> > &dof_locations = fe_values.get_quadrature_points ();
+ const std::vector<Point<dim> > &dof_locations
+ = fe_values.get_quadrature_points ();
if (fe_is_system)
{
+ // resize
+ // array. avoid
+ // construction of a
+ // memory allocating
+ // temporary if
+ // possible
+ if (dof_values_system.size() < fe.dofs_per_face)
+ dof_values_system.resize (fe.dofs_per_face,
+ Vector<double>(fe.n_components()));
+ else
+ dof_values_system.resize (fe.dofs_per_face);
+
function_map.find(boundary_component)->second
->vector_value_list (dof_locations, dof_values_system);
{
// get only the one component that
// this function has
- function_map.find(boundary_component)->second->value_list (dof_locations,
- dof_values_scalar,
- 0);
+ dof_values_scalar.resize (fe.dofs_per_face);
+ function_map.find(boundary_component)->second
+ ->value_list (dof_locations, dof_values_scalar, 0);
// enter into list
-template <int dim>
+template <int dim, template <int> class DH>
void
VectorTools::interpolate_boundary_values (const Mapping<dim> &mapping,
- const DoFHandler<dim> &dof,
+ const DH<dim> &dof,
const unsigned char boundary_component,
const Function<dim> &boundary_function,
std::map<unsigned int,double> &boundary_values,
-template <int dim>
+//TODO[?] Change for real hpDoFHandler
+// This function might not work anymore if the real hpDoFHandler is available.
+template <int dim, template <int> class DH>
void
-VectorTools::interpolate_boundary_values (const DoFHandler<dim> &dof,
+VectorTools::interpolate_boundary_values (const DH<dim> &dof,
const unsigned char boundary_component,
const Function<dim> &boundary_function,
std::map<unsigned int,double> &boundary_values,
-template <int dim>
+//TODO[?] Change for real hpDoFHandler
+// This function might not work anymore if the real hpDoFHandler is available.
+template <int dim, template <int> class DH>
void
-VectorTools::interpolate_boundary_values (const DoFHandler<dim> &dof,
+VectorTools::interpolate_boundary_values (const DH<dim> &dof,
const typename FunctionMap<dim>::type &function_map,
std::map<unsigned int,double> &boundary_values,
const std::vector<bool> &component_mask)
dof_to_boundary_mapping);
// set up sparsity structure
- SparsityPattern sparsity(dof.n_boundary_dofs(boundary_functions),
+ SparsityPattern sparsity(dof.n_boundary_dofs (boundary_functions),
dof.max_couplings_between_boundary_dofs());
DoFTools::make_boundary_sparsity_pattern (dof,
boundary_functions,
#include <dofs/dof_accessor.templates.h>
#include <dofs/dof_handler.h>
#include <dofs/dof_levels.h>
+#include <dofs/hp_dof_handler.h>
#include <grid/tria_boundary.h>
#include <grid/tria_iterator.h>
#include <grid/tria_iterator.templates.h>
/*------------------------- Functions: DoFObjectAccessor<1,dim> -----------------------*/
-template <int dim>
-void DoFObjectAccessor<1, dim>::set_dof_index (const unsigned int i,
- const unsigned int index) const
+template <int dim, template <int> class DH>
+void DoFObjectAccessor<1, dim, DH>::set_dof_index (const unsigned int i,
+ const unsigned int index) const
{
+ typedef DoFAccessor<dim, DH> BaseClass;
+
Assert (this->dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
// make sure a FE has been selected
// and enough room was reserved
Assert (&this->get_fe() != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (i<this->get_fe().dofs_per_line,
ExcIndexRange (i, 0, this->get_fe().dofs_per_line));
-template <int dim>
-void DoFObjectAccessor<1, dim>::set_vertex_dof_index (const unsigned int vertex,
- const unsigned int i,
- const unsigned int index) const
+template <int dim, template <int> class DH>
+void DoFObjectAccessor<1, dim, DH>::set_vertex_dof_index (const unsigned int vertex,
+ const unsigned int i,
+ const unsigned int index) const
{
// since the exception classes are
// non-template dependent name and
// use that to specify the
// qualified exception names
- typedef DoFAccessor<dim> BaseClass;
+ typedef DoFAccessor<dim, DH> BaseClass;
Assert (this->dof_handler != 0,
typename BaseClass::ExcInvalidObject());
-template <int dim>
+template <int dim, template <int> class DH>
template <class InputVector, typename number>
void
-DoFObjectAccessor<1,dim>::get_dof_values (const InputVector &values,
- Vector<number> &local_values) const
+DoFObjectAccessor<1,dim,DH>::get_dof_values (const InputVector &values,
+ Vector<number> &local_values) const
{
+ typedef DoFAccessor<1, DH> BaseClass;
+
Assert (dim==1, ExcInternalError());
- Assert (this->dof_handler != 0, DoFAccessor<1>::ExcInvalidObject());
- Assert (&this->dof_handler->get_fe() != 0, DoFAccessor<1>::ExcInvalidObject());
- Assert (local_values.size() == this->dof_handler->get_fe().dofs_per_cell,
- DoFAccessor<1>::ExcVectorDoesNotMatch());
+ Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject());
+ Assert (&this->get_fe() != 0,
+ typename BaseClass::ExcInvalidObject());
+ Assert (local_values.size() == this->get_fe().dofs_per_cell,
+ typename BaseClass::ExcVectorDoesNotMatch());
Assert (values.size() == this->dof_handler->n_dofs(),
- DoFAccessor<1>::ExcVectorDoesNotMatch());
- Assert (this->has_children() == false, DoFAccessor<1>::ExcNotActive());
+ typename BaseClass::ExcVectorDoesNotMatch());
+ Assert (this->has_children() == false,
+ typename BaseClass::ExcNotActive());
- const unsigned int dofs_per_vertex = this->dof_handler->get_fe().dofs_per_vertex,
- dofs_per_line = this->dof_handler->get_fe().dofs_per_line;
+ const unsigned int dofs_per_vertex = this->get_fe().dofs_per_vertex,
+ dofs_per_line = this->get_fe().dofs_per_line;
typename Vector<number>::iterator next_local_value=local_values.begin();
for (unsigned int vertex=0; vertex<2; ++vertex)
for (unsigned int d=0; d<dofs_per_vertex; ++d)
-template <int dim>
+template <int dim, template <int> class DH>
template <class OutputVector, typename number>
void
-DoFObjectAccessor<1,dim>::set_dof_values (const Vector<number> &local_values,
- OutputVector &values) const
+DoFObjectAccessor<1,dim,DH>::set_dof_values (const Vector<number> &local_values,
+ OutputVector &values) const
{
+ typedef DoFAccessor<1, DH> BaseClass;
+
Assert (dim==1, ExcInternalError());
- Assert (this->dof_handler != 0, DoFAccessor<1>::ExcInvalidObject());
- Assert (&this->dof_handler->get_fe() != 0, DoFAccessor<1>::ExcInvalidObject());
- Assert (local_values.size() == this->dof_handler->get_fe().dofs_per_cell,
- DoFAccessor<1>::ExcVectorDoesNotMatch());
+ Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject());
+ Assert (&this->get_fe() != 0,
+ typename BaseClass::ExcInvalidObject());
+ Assert (local_values.size() == this->get_fe().dofs_per_cell,
+ typename BaseClass::ExcVectorDoesNotMatch());
Assert (values.size() == this->dof_handler->n_dofs(),
- DoFAccessor<1>::ExcVectorDoesNotMatch());
- Assert (this->has_children() == false, DoFAccessor<1>::ExcNotActive());
+ typename BaseClass::ExcVectorDoesNotMatch());
+ Assert (this->has_children() == false,
+ typename BaseClass::ExcNotActive());
- const unsigned int dofs_per_vertex = this->dof_handler->get_fe().dofs_per_vertex,
- dofs_per_line = this->dof_handler->get_fe().dofs_per_line;
+ const unsigned int dofs_per_vertex = this->get_fe().dofs_per_vertex,
+ dofs_per_line = this->get_fe().dofs_per_line;
typename Vector<number>::const_iterator next_local_value=local_values.begin();
for (unsigned int vertex=0; vertex<2; ++vertex)
for (unsigned int d=0; d<dofs_per_vertex; ++d)
/*------------------------- Functions: DoFObjectAccessor<2,dim> -----------------------*/
-template <int dim>
-void DoFObjectAccessor<2, dim>::set_dof_index (const unsigned int i,
- const unsigned int index) const
+template <int dim, template <int> class DH>
+void DoFObjectAccessor<2, dim, DH>::set_dof_index (const unsigned int i,
+ const unsigned int index) const
{
+ typedef DoFAccessor<dim, DH> BaseClass;
+
Assert (this->dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
// make sure a FE has been selected
// and enough room was reserved
Assert (&this->get_fe() != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (i<this->get_fe().dofs_per_quad,
ExcIndexRange (i, 0, this->get_fe().dofs_per_quad));
-template <int dim>
+template <int dim, template <int> class DH>
void
-DoFObjectAccessor<2, dim>::set_vertex_dof_index (const unsigned int vertex,
- const unsigned int i,
- const unsigned int index) const
+DoFObjectAccessor<2, dim, DH>::set_vertex_dof_index (const unsigned int vertex,
+ const unsigned int i,
+ const unsigned int index) const
{
+ typedef DoFAccessor<dim, DH> BaseClass;
+
Assert (this->dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (&this->get_fe() != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (vertex<4, ExcIndexRange (i,0,4));
Assert (i<this->get_fe().dofs_per_vertex,
ExcIndexRange (i, 0, this->get_fe().dofs_per_vertex));
-template <int dim>
+template <int dim, template <int> class DH>
template <class InputVector, typename number>
void
-DoFObjectAccessor<2,dim>::get_dof_values (const InputVector &values,
- Vector<number> &local_values) const
+DoFObjectAccessor<2,dim,DH>::get_dof_values (const InputVector &values,
+ Vector<number> &local_values) const
{
+ typedef DoFAccessor<dim, DH> BaseClass;
+
Assert (dim==2, ExcInternalError());
Assert (this->dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
- Assert (&this->dof_handler->get_fe() != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
- Assert (local_values.size() == this->dof_handler->get_fe().dofs_per_cell,
- typename DoFAccessor<dim>::ExcVectorDoesNotMatch());
+ typename BaseClass::ExcInvalidObject());
+ Assert (&this->get_fe() != 0,
+ typename BaseClass::ExcInvalidObject());
+ Assert (local_values.size() == this->get_fe().dofs_per_cell,
+ typename BaseClass::ExcVectorDoesNotMatch());
Assert (values.size() == this->dof_handler->n_dofs(),
- typename DoFAccessor<dim>::ExcVectorDoesNotMatch());
- Assert (this->has_children() == false, typename DoFAccessor<dim>::
- ExcNotActive());
+ typename BaseClass::ExcVectorDoesNotMatch());
+ Assert (this->has_children() == false,
+ typename BaseClass::ExcNotActive());
- const unsigned int dofs_per_vertex = this->dof_handler->get_fe().dofs_per_vertex,
- dofs_per_line = this->dof_handler->get_fe().dofs_per_line,
- dofs_per_quad = this->dof_handler->get_fe().dofs_per_quad;
+ const unsigned int dofs_per_vertex = this->get_fe().dofs_per_vertex,
+ dofs_per_line = this->get_fe().dofs_per_line,
+ dofs_per_quad = this->get_fe().dofs_per_quad;
typename Vector<number>::iterator next_local_value=local_values.begin();
for (unsigned int vertex=0; vertex<4; ++vertex)
for (unsigned int d=0; d<dofs_per_vertex; ++d)
-template <int dim>
+template <int dim, template <int> class DH>
template <class OutputVector, typename number>
void
-DoFObjectAccessor<2,dim>::set_dof_values (const Vector<number> &local_values,
- OutputVector &values) const
+DoFObjectAccessor<2,dim,DH>::set_dof_values (const Vector<number> &local_values,
+ OutputVector &values) const
{
+ typedef DoFAccessor<dim, DH> BaseClass;
+
Assert (dim==2, ExcInternalError());
Assert (this->dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
- Assert (&this->dof_handler->get_fe() != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
- Assert (local_values.size() == this->dof_handler->get_fe().dofs_per_cell,
- typename DoFAccessor<dim>::ExcVectorDoesNotMatch());
+ typename BaseClass::ExcInvalidObject());
+ Assert (&this->get_fe() != 0,
+ typename BaseClass::ExcInvalidObject());
+ Assert (local_values.size() == this->get_fe().dofs_per_cell,
+ typename BaseClass::ExcVectorDoesNotMatch());
Assert (values.size() == this->dof_handler->n_dofs(),
- typename DoFAccessor<dim>::ExcVectorDoesNotMatch());
+ typename BaseClass::ExcVectorDoesNotMatch());
Assert (this->has_children() == false,
- typename DoFAccessor<dim>::ExcNotActive());
+ typename BaseClass::ExcNotActive());
- const unsigned int dofs_per_vertex = this->dof_handler->get_fe().dofs_per_vertex,
- dofs_per_line = this->dof_handler->get_fe().dofs_per_line,
- dofs_per_quad = this->dof_handler->get_fe().dofs_per_quad;
+ const unsigned int dofs_per_vertex = this->get_fe().dofs_per_vertex,
+ dofs_per_line = this->get_fe().dofs_per_line,
+ dofs_per_quad = this->get_fe().dofs_per_quad;
typename Vector<number>::const_iterator next_local_value=local_values.begin();
for (unsigned int vertex=0; vertex<4; ++vertex)
for (unsigned int d=0; d<dofs_per_vertex; ++d)
/*------------------------- Functions: DoFObjectAccessor<3,dim> -----------------------*/
-template <int dim>
-void DoFObjectAccessor<3, dim>::set_dof_index (const unsigned int i,
- const unsigned int index) const
+template <int dim, template <int> class DH>
+void DoFObjectAccessor<3, dim, DH>::set_dof_index (const unsigned int i,
+ const unsigned int index) const
{
+ typedef DoFAccessor<dim, DH> BaseClass;
+
Assert (this->dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
// make sure a FE has been selected
// and enough room was reserved
Assert (&this->get_fe() != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (i<this->get_fe().dofs_per_hex,
ExcIndexRange (i, 0, this->get_fe().dofs_per_hex));
-template <int dim>
-void DoFObjectAccessor<3, dim>::set_vertex_dof_index (const unsigned int vertex,
- const unsigned int i,
- const unsigned int index) const
+template <int dim, template <int> class DH>
+void DoFObjectAccessor<3, dim, DH>::set_vertex_dof_index (const unsigned int vertex,
+ const unsigned int i,
+ const unsigned int index) const
{
+ typedef DoFAccessor<dim, DH> BaseClass;
+
Assert (this->dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (&this->get_fe() != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (vertex<8,
ExcIndexRange (i,0,8));
Assert (i<this->get_fe().dofs_per_vertex,
-template <int dim>
+template <int dim, template <int> class DH>
template <class InputVector, typename number>
void
-DoFObjectAccessor<3,dim>::get_dof_values (const InputVector &values,
- Vector<number> &local_values) const
+DoFObjectAccessor<3,dim,DH>::get_dof_values (const InputVector &values,
+ Vector<number> &local_values) const
{
+ typedef DoFAccessor<3, DH> BaseClass;
+
Assert (dim==3, ExcInternalError());
- Assert (this->dof_handler != 0, DoFAccessor<3>::ExcInvalidObject());
- Assert (&this->dof_handler->get_fe() != 0, DoFAccessor<3>::ExcInvalidObject());
- Assert (local_values.size() == this->dof_handler->get_fe().dofs_per_cell,
- DoFAccessor<3>::ExcVectorDoesNotMatch());
+ Assert (this->dof_handler != 0,
+ typename BaseClass::ExcInvalidObject());
+ Assert (&this->get_fe() != 0,
+ typename BaseClass::ExcInvalidObject());
+ Assert (local_values.size() == this->get_fe().dofs_per_cell,
+ typename BaseClass::ExcVectorDoesNotMatch());
Assert (values.size() == this->dof_handler->n_dofs(),
- DoFAccessor<3>::ExcVectorDoesNotMatch());
+ typename BaseClass::ExcVectorDoesNotMatch());
Assert (this->has_children() == false,
- DoFAccessor<3>::ExcNotActive());
+ typename BaseClass::ExcNotActive());
- const unsigned int dofs_per_vertex = this->dof_handler->get_fe().dofs_per_vertex,
- dofs_per_line = this->dof_handler->get_fe().dofs_per_line,
- dofs_per_quad = this->dof_handler->get_fe().dofs_per_quad,
- dofs_per_hex = this->dof_handler->get_fe().dofs_per_hex;
+ const unsigned int dofs_per_vertex = this->get_fe().dofs_per_vertex,
+ dofs_per_line = this->get_fe().dofs_per_line,
+ dofs_per_quad = this->get_fe().dofs_per_quad,
+ dofs_per_hex = this->get_fe().dofs_per_hex;
typename Vector<number>::iterator next_local_value = local_values.begin();
for (unsigned int vertex=0; vertex<GeometryInfo<3>::vertices_per_cell; ++vertex)
for (unsigned int d=0; d<dofs_per_vertex; ++d)
-template <int dim>
+template <int dim, template <int> class DH>
template <class OutputVector, typename number>
void
-DoFObjectAccessor<3,dim>::set_dof_values (const Vector<number> &local_values,
- OutputVector &values) const
+DoFObjectAccessor<3,dim,DH>::set_dof_values (const Vector<number> &local_values,
+ OutputVector &values) const
{
+ typedef DoFAccessor<3, DH> BaseClass;
+
Assert (dim==3, ExcInternalError());
Assert (this->dof_handler != 0,
- DoFAccessor<3>::ExcInvalidObject());
- Assert (&this->dof_handler->get_fe() != 0,
- DoFAccessor<3>::ExcInvalidObject());
- Assert (local_values.size() == this->dof_handler->get_fe().dofs_per_cell,
- DoFAccessor<3>::ExcVectorDoesNotMatch());
+ typename BaseClass::ExcInvalidObject());
+ Assert (&this->get_fe() != 0,
+ typename BaseClass::ExcInvalidObject());
+ Assert (local_values.size() == this->get_fe().dofs_per_cell,
+ typename BaseClass::ExcVectorDoesNotMatch());
Assert (values.size() == this->dof_handler->n_dofs(),
- DoFAccessor<3>::ExcVectorDoesNotMatch());
+ typename BaseClass::ExcVectorDoesNotMatch());
Assert (this->has_children() == false,
- DoFAccessor<3>::ExcNotActive());
+ typename BaseClass::ExcNotActive());
- const unsigned int dofs_per_vertex = this->dof_handler->get_fe().dofs_per_vertex,
- dofs_per_line = this->dof_handler->get_fe().dofs_per_line,
- dofs_per_quad = this->dof_handler->get_fe().dofs_per_quad,
- dofs_per_hex = this->dof_handler->get_fe().dofs_per_hex;
+ const unsigned int dofs_per_vertex = this->get_fe().dofs_per_vertex,
+ dofs_per_line = this->get_fe().dofs_per_line,
+ dofs_per_quad = this->get_fe().dofs_per_quad,
+ dofs_per_hex = this->get_fe().dofs_per_hex;
typename Vector<number>::const_iterator next_local_value=local_values.begin();
for (unsigned int vertex=0; vertex<GeometryInfo<dim>::vertices_per_cell; ++vertex)
for (unsigned int d=0; d<dofs_per_vertex; ++d)
}
-
/*------------------------- Functions: DoFCellAccessor -----------------------*/
#if deal_II_dimension == 1
template <>
-TriaIterator<1, DoFObjectAccessor<0,1> >
-DoFCellAccessor<1>::face (const unsigned int) const
+TriaIterator<1, DoFObjectAccessor<0,1,DoFHandler> >
+DoFCellAccessor<1,DoFHandler>::face (const unsigned int) const
{
Assert (false, ExcImpossibleInDim(1));
- return TriaIterator<1, DoFObjectAccessor<0,1> >();
+ return TriaIterator<1, DoFObjectAccessor<0,1, DoFHandler> >();
}
#endif
#if deal_II_dimension == 2
template <>
-TriaIterator<2, DoFObjectAccessor<1,2> >
-DoFCellAccessor<2>::face (const unsigned int i) const
+TriaIterator<2, DoFObjectAccessor<1,2,DoFHandler> >
+DoFCellAccessor<2,DoFHandler>::face (const unsigned int i) const
{
return this->line(i);
}
#if deal_II_dimension == 3
template <>
-TriaIterator<3, DoFObjectAccessor<2, 3> >
-DoFCellAccessor<3>::face (const unsigned int i) const
+TriaIterator<3, DoFObjectAccessor<2, 3, DoFHandler> >
+DoFCellAccessor<3,DoFHandler>::face (const unsigned int i) const
{
return this->quad(i);
}
#endif
-
-template <int dim>
-TriaIterator<dim,DoFCellAccessor<dim> >
-DoFCellAccessor<dim>::
+template <int dim, template <int> class DH>
+TriaIterator<dim,DoFCellAccessor<dim,DH> >
+DoFCellAccessor<dim,DH>::
neighbor_child_on_subface (const unsigned int face,
const unsigned int subface) const
{
const TriaIterator<dim,CellAccessor<dim> > q
= CellAccessor<dim>::neighbor_child_on_subface (face, subface);
- return TriaIterator<dim,DoFCellAccessor<dim> > (this->tria,
- q->level (),
- q->index (),
- this->dof_handler);
+ return TriaIterator<dim,DoFCellAccessor<dim,DH> > (this->tria,
+ q->level (),
+ q->index (),
+ this->dof_handler);
}
-template <int dim>
+template <int dim, template <int> class DH>
template <class InputVector, typename number>
void
-DoFCellAccessor<dim>::get_interpolated_dof_values (const InputVector &values,
- Vector<number> &interpolated_values) const
+DoFCellAccessor<dim,DH>::
+get_interpolated_dof_values (const InputVector &values,
+ Vector<number> &interpolated_values) const
{
- const FiniteElement<dim> &fe = this->dof_handler->get_fe();
+ const FiniteElement<dim> &fe = this->get_fe();
const unsigned int dofs_per_cell = fe.dofs_per_cell;
+ typedef DoFAccessor<dim, DH> BaseClass;
Assert (this->dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (&fe != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (interpolated_values.size() == dofs_per_cell,
- typename DoFAccessor<dim>::ExcVectorDoesNotMatch());
+ typename BaseClass::ExcVectorDoesNotMatch());
Assert (values.size() == this->dof_handler->n_dofs(),
- typename DoFAccessor<dim>::ExcVectorDoesNotMatch());
+ typename BaseClass::ExcVectorDoesNotMatch());
if (!this->has_children())
// if this cell has no children: simply
-template <int dim>
+template <int dim, template <int> class DH>
template <class OutputVector, typename number>
void
-DoFCellAccessor<dim>::set_dof_values_by_interpolation (const Vector<number> &local_values,
- OutputVector &values) const
+DoFCellAccessor<dim,DH>::
+set_dof_values_by_interpolation (const Vector<number> &local_values,
+ OutputVector &values) const
{
- const unsigned int dofs_per_cell = this->dof_handler->get_fe().dofs_per_cell;
+ const unsigned int dofs_per_cell = this->get_fe().dofs_per_cell;
+ typedef DoFAccessor<dim, DH> BaseClass;
Assert (this->dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
- Assert (&this->dof_handler->get_fe() != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
+ Assert (&this->get_fe() != 0,
+ typename BaseClass::ExcInvalidObject());
Assert (local_values.size() == dofs_per_cell,
- typename DoFAccessor<dim>::ExcVectorDoesNotMatch());
+ typename BaseClass::ExcVectorDoesNotMatch());
Assert (values.size() == this->dof_handler->n_dofs(),
- typename DoFAccessor<dim>::ExcVectorDoesNotMatch());
+ typename BaseClass::ExcVectorDoesNotMatch());
if (!this->has_children())
// if this cell has no children: simply
{
// prolong the given data
// to the present cell
- this->dof_handler->get_fe().get_prolongation_matrix(child)
+ this->get_fe().get_prolongation_matrix(child)
.vmult (tmp, local_values);
this->child(child)->set_dof_values_by_interpolation (tmp, values);
};
// --------------------------------------------------------------------------
-// explicit instantiations
+// explicit instantiations (for DoFHandler)
template
void
-DoFObjectAccessor<1,deal_II_dimension>::get_dof_values<Vector<double>,double>
+DoFObjectAccessor<1,deal_II_dimension,DoFHandler>::get_dof_values<Vector<double>,double>
(const Vector<double>&, Vector<double>&) const;
template
void
-DoFObjectAccessor<1,deal_II_dimension>::set_dof_values<Vector<double>,double>
+DoFObjectAccessor<1,deal_II_dimension,DoFHandler>::set_dof_values<Vector<double>,double>
(const Vector<double>&, Vector<double>&) const;
template
void
-DoFObjectAccessor<1,deal_II_dimension>::get_dof_values<Vector<double>,float>
+DoFObjectAccessor<1,deal_II_dimension,DoFHandler>::get_dof_values<Vector<double>,float>
(const Vector<double>&, Vector<float>&) const;
template
void
-DoFObjectAccessor<1,deal_II_dimension>::set_dof_values<Vector<float>,double>
+DoFObjectAccessor<1,deal_II_dimension,DoFHandler>::set_dof_values<Vector<float>,double>
(const Vector<double>&, Vector<float>&) const;
template
void
-DoFObjectAccessor<1,deal_II_dimension>::get_dof_values<Vector<float>,double>
+DoFObjectAccessor<1,deal_II_dimension,DoFHandler>::get_dof_values<Vector<float>,double>
(const Vector<float>&, Vector<double>&) const;
template
void
-DoFObjectAccessor<1,deal_II_dimension>::set_dof_values<Vector<double>,float>
+DoFObjectAccessor<1,deal_II_dimension,DoFHandler>::set_dof_values<Vector<double>,float>
(const Vector<float>&, Vector<double>&) const;
template
void
-DoFObjectAccessor<1,deal_II_dimension>::get_dof_values<Vector<float>,float>
+DoFObjectAccessor<1,deal_II_dimension,DoFHandler>::get_dof_values<Vector<float>,float>
(const Vector<float>&, Vector<float>&) const;
template
void
-DoFObjectAccessor<1,deal_II_dimension>::set_dof_values<Vector<float>,float>
+DoFObjectAccessor<1,deal_II_dimension,DoFHandler>::set_dof_values<Vector<float>,float>
(const Vector<float>&, Vector<float>&) const;
// for block vector
template
void
-DoFObjectAccessor<1,deal_II_dimension>::get_dof_values<BlockVector<double>,double>
+DoFObjectAccessor<1,deal_II_dimension,DoFHandler>::get_dof_values<BlockVector<double>,double>
(const BlockVector<double> &, Vector<double>&) const;
template
void
-DoFObjectAccessor<1,deal_II_dimension>::set_dof_values<BlockVector<double>,double>
+DoFObjectAccessor<1,deal_II_dimension,DoFHandler>::set_dof_values<BlockVector<double>,double>
(const Vector<double>&, BlockVector<double>&) const;
template
void
-DoFObjectAccessor<1,deal_II_dimension>::get_dof_values<BlockVector<double>,float>
+DoFObjectAccessor<1,deal_II_dimension,DoFHandler>::get_dof_values<BlockVector<double>,float>
(const BlockVector<double> &, Vector<float>&) const;
template
void
-DoFObjectAccessor<1,deal_II_dimension>::set_dof_values<BlockVector<float>,double>
+DoFObjectAccessor<1,deal_II_dimension,DoFHandler>::set_dof_values<BlockVector<float>,double>
(const Vector<double>&, BlockVector<float>&) const;
template
void
-DoFObjectAccessor<1,deal_II_dimension>::get_dof_values<BlockVector<float>,double>
+DoFObjectAccessor<1,deal_II_dimension,DoFHandler>::get_dof_values<BlockVector<float>,double>
(const BlockVector<float> &, Vector<double>&) const;
template
void
-DoFObjectAccessor<1,deal_II_dimension>::set_dof_values<BlockVector<double>,float>
+DoFObjectAccessor<1,deal_II_dimension,DoFHandler>::set_dof_values<BlockVector<double>,float>
(const Vector<float>&, BlockVector<double>&) const;
template
void
-DoFObjectAccessor<1,deal_II_dimension>::get_dof_values<BlockVector<float>,float>
+DoFObjectAccessor<1,deal_II_dimension,DoFHandler>::get_dof_values<BlockVector<float>,float>
(const BlockVector<float>&, Vector<float>&) const;
template
void
-DoFObjectAccessor<1,deal_II_dimension>::set_dof_values<BlockVector<float>,float>
+DoFObjectAccessor<1,deal_II_dimension,DoFHandler>::set_dof_values<BlockVector<float>,float>
(const Vector<float>&, BlockVector<float>&) const;
// for Petsc vectors
#ifdef DEAL_II_USE_PETSC
template
void
-DoFObjectAccessor<1,deal_II_dimension>::get_dof_values<PETScWrappers::Vector,double>
+DoFObjectAccessor<1,deal_II_dimension,DoFHandler>::get_dof_values<PETScWrappers::Vector,double>
(const PETScWrappers::Vector &, Vector<double>&) const;
template
void
-DoFObjectAccessor<1,deal_II_dimension>::get_dof_values<PETScWrappers::Vector,float>
+DoFObjectAccessor<1,deal_II_dimension,DoFHandler>::get_dof_values<PETScWrappers::Vector,float>
(const PETScWrappers::Vector &, Vector<float>&) const;
template
void
-DoFObjectAccessor<1,deal_II_dimension>::set_dof_values<PETScWrappers::Vector,double>
+DoFObjectAccessor<1,deal_II_dimension,DoFHandler>::set_dof_values<PETScWrappers::Vector,double>
(const Vector<double> &, PETScWrappers::Vector&) const;
template
void
-DoFObjectAccessor<1,deal_II_dimension>::set_dof_values<PETScWrappers::Vector,float>
+DoFObjectAccessor<1,deal_II_dimension,DoFHandler>::set_dof_values<PETScWrappers::Vector,float>
(const Vector<float>&, PETScWrappers::Vector&) const;
template
void
-DoFObjectAccessor<1,deal_II_dimension>::get_dof_values<PETScWrappers::BlockVector,double>
+DoFObjectAccessor<1,deal_II_dimension,DoFHandler>::get_dof_values<PETScWrappers::BlockVector,double>
(const PETScWrappers::BlockVector &, Vector<double>&) const;
template
void
-DoFObjectAccessor<1,deal_II_dimension>::get_dof_values<PETScWrappers::BlockVector,float>
+DoFObjectAccessor<1,deal_II_dimension,DoFHandler>::get_dof_values<PETScWrappers::BlockVector,float>
(const PETScWrappers::BlockVector &, Vector<float>&) const;
template
void
-DoFObjectAccessor<1,deal_II_dimension>::set_dof_values<PETScWrappers::BlockVector,double>
+DoFObjectAccessor<1,deal_II_dimension,DoFHandler>::set_dof_values<PETScWrappers::BlockVector,double>
(const Vector<double> &, PETScWrappers::BlockVector&) const;
template
void
-DoFObjectAccessor<1,deal_II_dimension>::set_dof_values<PETScWrappers::BlockVector,float>
+DoFObjectAccessor<1,deal_II_dimension,DoFHandler>::set_dof_values<PETScWrappers::BlockVector,float>
(const Vector<float>&, PETScWrappers::BlockVector&) const;
#endif
#if deal_II_dimension >= 2
template
void
-DoFObjectAccessor<2,deal_II_dimension>::get_dof_values<Vector<double>,double>
+DoFObjectAccessor<2,deal_II_dimension,DoFHandler>::get_dof_values<Vector<double>,double>
(const Vector<double>&, Vector<double>&) const;
template
void
-DoFObjectAccessor<2,deal_II_dimension>::set_dof_values<Vector<double>,double>
+DoFObjectAccessor<2,deal_II_dimension,DoFHandler>::set_dof_values<Vector<double>,double>
(const Vector<double>&, Vector<double>&) const;
template
void
-DoFObjectAccessor<2,deal_II_dimension>::get_dof_values<Vector<double>,float>
+DoFObjectAccessor<2,deal_II_dimension,DoFHandler>::get_dof_values<Vector<double>,float>
(const Vector<double>&, Vector<float>&) const;
template
void
-DoFObjectAccessor<2,deal_II_dimension>::set_dof_values<Vector<float>,double>
+DoFObjectAccessor<2,deal_II_dimension,DoFHandler>::set_dof_values<Vector<float>,double>
(const Vector<double>&, Vector<float>&) const;
template
void
-DoFObjectAccessor<2,deal_II_dimension>::get_dof_values<Vector<float>,double>
+DoFObjectAccessor<2,deal_II_dimension,DoFHandler>::get_dof_values<Vector<float>,double>
(const Vector<float>&, Vector<double>&) const;
template
void
-DoFObjectAccessor<2,deal_II_dimension>::set_dof_values<Vector<double>,float>
+DoFObjectAccessor<2,deal_II_dimension,DoFHandler>::set_dof_values<Vector<double>,float>
(const Vector<float>&, Vector<double>&) const;
template
void
-DoFObjectAccessor<2,deal_II_dimension>::get_dof_values<Vector<float>,float>
+DoFObjectAccessor<2,deal_II_dimension,DoFHandler>::get_dof_values<Vector<float>,float>
(const Vector<float>&, Vector<float>&) const;
template
void
-DoFObjectAccessor<2,deal_II_dimension>::set_dof_values<Vector<float>,float>
+DoFObjectAccessor<2,deal_II_dimension,DoFHandler>::set_dof_values<Vector<float>,float>
(const Vector<float>&, Vector<float>&) const;
// for block vector
template
void
-DoFObjectAccessor<2,deal_II_dimension>::get_dof_values<BlockVector<double>,double>
+DoFObjectAccessor<2,deal_II_dimension,DoFHandler>::get_dof_values<BlockVector<double>,double>
(const BlockVector<double>&, Vector<double>&) const;
template
void
-DoFObjectAccessor<2,deal_II_dimension>::set_dof_values<BlockVector<double>,double>
+DoFObjectAccessor<2,deal_II_dimension,DoFHandler>::set_dof_values<BlockVector<double>,double>
(const Vector<double>&, BlockVector<double>&) const;
template
void
-DoFObjectAccessor<2,deal_II_dimension>::get_dof_values<BlockVector<double>,float>
+DoFObjectAccessor<2,deal_II_dimension,DoFHandler>::get_dof_values<BlockVector<double>,float>
(const BlockVector<double>&, Vector<float>&) const;
template
void
-DoFObjectAccessor<2,deal_II_dimension>::set_dof_values<BlockVector<float>,double>
+DoFObjectAccessor<2,deal_II_dimension,DoFHandler>::set_dof_values<BlockVector<float>,double>
(const Vector<double>&, BlockVector<float>&) const;
template
void
-DoFObjectAccessor<2,deal_II_dimension>::get_dof_values<BlockVector<float>,double>
+DoFObjectAccessor<2,deal_II_dimension,DoFHandler>::get_dof_values<BlockVector<float>,double>
(const BlockVector<float>&, Vector<double>&) const;
template
void
-DoFObjectAccessor<2,deal_II_dimension>::set_dof_values<BlockVector<double>,float>
+DoFObjectAccessor<2,deal_II_dimension,DoFHandler>::set_dof_values<BlockVector<double>,float>
(const Vector<float>&, BlockVector<double>&) const;
template
void
-DoFObjectAccessor<2,deal_II_dimension>::get_dof_values<BlockVector<float>,float>
+DoFObjectAccessor<2,deal_II_dimension,DoFHandler>::get_dof_values<BlockVector<float>,float>
(const BlockVector<float>&, Vector<float>&) const;
template
void
-DoFObjectAccessor<2,deal_II_dimension>::set_dof_values<BlockVector<float>,float>
+DoFObjectAccessor<2,deal_II_dimension,DoFHandler>::set_dof_values<BlockVector<float>,float>
(const Vector<float>&, BlockVector<float>&) const;
// for Petsc vectors
#ifdef DEAL_II_USE_PETSC
template
void
-DoFObjectAccessor<2,deal_II_dimension>::get_dof_values<PETScWrappers::Vector,double>
+DoFObjectAccessor<2,deal_II_dimension,DoFHandler>::get_dof_values<PETScWrappers::Vector,double>
+(const PETScWrappers::Vector &, Vector<double>&) const;
+template
+void
+DoFObjectAccessor<2,deal_II_dimension,DoFHandler>::get_dof_values<PETScWrappers::Vector,float>
+(const PETScWrappers::Vector &, Vector<float>&) const;
+template
+void
+DoFObjectAccessor<2,deal_II_dimension,DoFHandler>::set_dof_values<PETScWrappers::Vector,double>
+(const Vector<double> &, PETScWrappers::Vector&) const;
+template
+void
+DoFObjectAccessor<2,deal_II_dimension,DoFHandler>::set_dof_values<PETScWrappers::Vector,float>
+(const Vector<float>&, PETScWrappers::Vector&) const;
+
+template
+void
+DoFObjectAccessor<2,deal_II_dimension,DoFHandler>::get_dof_values<PETScWrappers::BlockVector,double>
+(const PETScWrappers::BlockVector &, Vector<double>&) const;
+template
+void
+DoFObjectAccessor<2,deal_II_dimension,DoFHandler>::get_dof_values<PETScWrappers::BlockVector,float>
+(const PETScWrappers::BlockVector &, Vector<float>&) const;
+template
+void
+DoFObjectAccessor<2,deal_II_dimension,DoFHandler>::set_dof_values<PETScWrappers::BlockVector,double>
+(const Vector<double> &, PETScWrappers::BlockVector&) const;
+template
+void
+DoFObjectAccessor<2,deal_II_dimension,DoFHandler>::set_dof_values<PETScWrappers::BlockVector,float>
+(const Vector<float>&, PETScWrappers::BlockVector&) const;
+#endif
+#endif
+
+#if deal_II_dimension >= 3
+template
+void
+DoFObjectAccessor<3,deal_II_dimension,DoFHandler>::get_dof_values<Vector<double>,double>
+(const Vector<double>&, Vector<double>&) const;
+template
+void
+DoFObjectAccessor<3,deal_II_dimension,DoFHandler>::set_dof_values<Vector<double>,double>
+(const Vector<double>&, Vector<double>&) const;
+template
+void
+DoFObjectAccessor<3,deal_II_dimension,DoFHandler>::get_dof_values<Vector<double>,float>
+(const Vector<double>&, Vector<float>&) const;
+template
+void
+DoFObjectAccessor<3,deal_II_dimension,DoFHandler>::set_dof_values<Vector<float>,double>
+(const Vector<double>&, Vector<float>&) const;
+template
+void
+DoFObjectAccessor<3,deal_II_dimension,DoFHandler>::get_dof_values<Vector<float>,double>
+(const Vector<float>&, Vector<double>&) const;
+template
+void
+DoFObjectAccessor<3,deal_II_dimension,DoFHandler>::set_dof_values<Vector<double>,float>
+(const Vector<float>&, Vector<double>&) const;
+template
+void
+DoFObjectAccessor<3,deal_II_dimension,DoFHandler>::get_dof_values<Vector<float>,float>
+(const Vector<float>&, Vector<float>&) const;
+template
+void
+DoFObjectAccessor<3,deal_II_dimension,DoFHandler>::set_dof_values<Vector<float>,float>
+(const Vector<float>&, Vector<float>&) const;
+
+
+
+// for block vector
+template
+void
+DoFObjectAccessor<3,deal_II_dimension,DoFHandler>::get_dof_values<BlockVector<double>,double>
+(const BlockVector<double>&, Vector<double>&) const;
+template
+void
+DoFObjectAccessor<3,deal_II_dimension,DoFHandler>::set_dof_values<BlockVector<double>,double>
+(const Vector<double>&, BlockVector<double>&) const;
+template
+void
+DoFObjectAccessor<3,deal_II_dimension,DoFHandler>::get_dof_values<BlockVector<double>,float>
+(const BlockVector<double>&, Vector<float>&) const;
+template
+void
+DoFObjectAccessor<3,deal_II_dimension,DoFHandler>::set_dof_values<BlockVector<float>,double>
+(const Vector<double>&, BlockVector<float>&) const;
+template
+void
+DoFObjectAccessor<3,deal_II_dimension,DoFHandler>::get_dof_values<BlockVector<float>,double>
+(const BlockVector<float>&, Vector<double>&) const;
+template
+void
+DoFObjectAccessor<3,deal_II_dimension,DoFHandler>::set_dof_values<BlockVector<double>,float>
+(const Vector<float>&, BlockVector<double>&) const;
+template
+void
+DoFObjectAccessor<3,deal_II_dimension,DoFHandler>::get_dof_values<BlockVector<float>,float>
+(const BlockVector<float>&, Vector<float>&) const;
+template
+void
+DoFObjectAccessor<3,deal_II_dimension,DoFHandler>::set_dof_values<BlockVector<float>,float>
+(const Vector<float>&, BlockVector<float>&) const;
+
+// for Petsc vectors
+#if DEAL_II_USE_PETSC
+template
+void
+DoFObjectAccessor<3,deal_II_dimension,DoFHandler>::get_dof_values<PETScWrappers::Vector,double>
(const PETScWrappers::Vector &, Vector<double>&) const;
template
void
-DoFObjectAccessor<2,deal_II_dimension>::get_dof_values<PETScWrappers::Vector,float>
+DoFObjectAccessor<3,deal_II_dimension,DoFHandler>::get_dof_values<PETScWrappers::Vector,float>
(const PETScWrappers::Vector &, Vector<float>&) const;
template
void
-DoFObjectAccessor<2,deal_II_dimension>::set_dof_values<PETScWrappers::Vector,double>
+DoFObjectAccessor<3,deal_II_dimension,DoFHandler>::set_dof_values<PETScWrappers::Vector,double>
(const Vector<double> &, PETScWrappers::Vector&) const;
template
void
-DoFObjectAccessor<2,deal_II_dimension>::set_dof_values<PETScWrappers::Vector,float>
+DoFObjectAccessor<3,deal_II_dimension,DoFHandler>::set_dof_values<PETScWrappers::Vector,float>
(const Vector<float>&, PETScWrappers::Vector&) const;
template
void
-DoFObjectAccessor<2,deal_II_dimension>::get_dof_values<PETScWrappers::BlockVector,double>
+DoFObjectAccessor<3,deal_II_dimension,DoFHandler>::get_dof_values<PETScWrappers::BlockVector,double>
(const PETScWrappers::BlockVector &, Vector<double>&) const;
template
void
-DoFObjectAccessor<2,deal_II_dimension>::get_dof_values<PETScWrappers::BlockVector,float>
+DoFObjectAccessor<3,deal_II_dimension,DoFHandler>::get_dof_values<PETScWrappers::BlockVector,float>
(const PETScWrappers::BlockVector &, Vector<float>&) const;
template
void
-DoFObjectAccessor<2,deal_II_dimension>::set_dof_values<PETScWrappers::BlockVector,double>
+DoFObjectAccessor<3,deal_II_dimension,DoFHandler>::set_dof_values<PETScWrappers::BlockVector,double>
(const Vector<double> &, PETScWrappers::BlockVector&) const;
template
void
-DoFObjectAccessor<2,deal_II_dimension>::set_dof_values<PETScWrappers::BlockVector,float>
+DoFObjectAccessor<3,deal_II_dimension,DoFHandler>::set_dof_values<PETScWrappers::BlockVector,float>
(const Vector<float>&, PETScWrappers::BlockVector&) const;
#endif
#endif
+
+template
+void
+DoFCellAccessor<deal_II_dimension,DoFHandler>::
+get_interpolated_dof_values<Vector<double>,double>
+(const Vector<double>&, Vector<double>&) const;
+template
+void
+DoFCellAccessor<deal_II_dimension,DoFHandler>::
+set_dof_values_by_interpolation<Vector<double>,double>
+(const Vector<double>&, Vector<double>&) const;
+
+template
+void
+DoFCellAccessor<deal_II_dimension,DoFHandler>::
+get_interpolated_dof_values<Vector<double>,float>
+(const Vector<double>&, Vector<float>&) const;
+template
+void
+DoFCellAccessor<deal_II_dimension,DoFHandler>::
+set_dof_values_by_interpolation<Vector<float>,double>
+(const Vector<double>&, Vector<float>&) const;
+
+template
+void
+DoFCellAccessor<deal_II_dimension,DoFHandler>::
+get_interpolated_dof_values<Vector<float>,double>
+(const Vector<float>&, Vector<double>&) const;
+template
+void
+DoFCellAccessor<deal_II_dimension,DoFHandler>::
+set_dof_values_by_interpolation<Vector<double>,float>
+(const Vector<float>&, Vector<double>&) const;
+
+template
+void
+DoFCellAccessor<deal_II_dimension,DoFHandler>::
+get_interpolated_dof_values<Vector<float>,float>
+(const Vector<float>&, Vector<float>&) const;
+template
+void
+DoFCellAccessor<deal_II_dimension,DoFHandler>::
+set_dof_values_by_interpolation<Vector<float>,float>
+(const Vector<float>&, Vector<float>&) const;
+
+
+template
+void
+DoFCellAccessor<deal_II_dimension,DoFHandler>::
+get_interpolated_dof_values<BlockVector<double>,double>
+(const BlockVector<double>&, Vector<double>&) const;
+
+template
+void
+DoFCellAccessor<deal_II_dimension,DoFHandler>::
+set_dof_values_by_interpolation<BlockVector<double>,double>
+(const Vector<double>&, BlockVector<double>&) const;
+
+template
+void
+DoFCellAccessor<deal_II_dimension,DoFHandler>::
+get_interpolated_dof_values<BlockVector<double>,float>
+(const BlockVector<double>&, Vector<float>&) const;
+
+template
+void
+DoFCellAccessor<deal_II_dimension,DoFHandler>::
+set_dof_values_by_interpolation<BlockVector<float>,double>
+(const Vector<double>&, BlockVector<float>&) const;
+
+template
+void
+DoFCellAccessor<deal_II_dimension,DoFHandler>::
+get_interpolated_dof_values<BlockVector<float>,double>
+(const BlockVector<float>&, Vector<double>&) const;
+template
+void
+DoFCellAccessor<deal_II_dimension,DoFHandler>::
+set_dof_values_by_interpolation<BlockVector<double>,float>
+(const Vector<float>&, BlockVector<double>&) const;
+
+template
+void
+DoFCellAccessor<deal_II_dimension,DoFHandler>::
+get_interpolated_dof_values<BlockVector<float>,float>
+(const BlockVector<float>&, Vector<float>&) const;
+template
+void
+DoFCellAccessor<deal_II_dimension,DoFHandler>::
+set_dof_values_by_interpolation<BlockVector<float>,float>
+(const Vector<float>&, BlockVector<float>&) const;
+
+// for Petsc vectors
+#if DEAL_II_USE_PETSC
+template
+void
+DoFCellAccessor<deal_II_dimension,DoFHandler>::
+get_interpolated_dof_values<PETScWrappers::Vector,double>
+(const PETScWrappers::Vector&, Vector<double>&) const;
+template
+void
+DoFCellAccessor<deal_II_dimension,DoFHandler>::
+set_dof_values_by_interpolation<PETScWrappers::Vector,double>
+(const Vector<double>&, PETScWrappers::Vector&) const;
+
+template
+void
+DoFCellAccessor<deal_II_dimension,DoFHandler>::
+get_interpolated_dof_values<PETScWrappers::Vector,float>
+(const PETScWrappers::Vector&, Vector<float>&) const;
+template
+void
+DoFCellAccessor<deal_II_dimension,DoFHandler>::
+set_dof_values_by_interpolation<PETScWrappers::Vector,float>
+(const Vector<float>&, PETScWrappers::Vector&) const;
+
+
+template
+void
+DoFCellAccessor<deal_II_dimension,DoFHandler>::
+get_interpolated_dof_values<PETScWrappers::BlockVector,double>
+(const PETScWrappers::BlockVector&, Vector<double>&) const;
+template
+void
+DoFCellAccessor<deal_II_dimension,DoFHandler>::
+set_dof_values_by_interpolation<PETScWrappers::BlockVector,double>
+(const Vector<double>&, PETScWrappers::BlockVector&) const;
+
+template
+void
+DoFCellAccessor<deal_II_dimension,DoFHandler>::
+get_interpolated_dof_values<PETScWrappers::BlockVector,float>
+(const PETScWrappers::BlockVector&, Vector<float>&) const;
+template
+void
+DoFCellAccessor<deal_II_dimension,DoFHandler>::
+set_dof_values_by_interpolation<PETScWrappers::BlockVector,float>
+(const Vector<float>&, PETScWrappers::BlockVector&) const;
+
+#endif
+
+
+template class DoFAccessor<deal_II_dimension, DoFHandler>;
+
+#if deal_II_dimension == 1
+template class DoFObjectAccessor<1, 1, DoFHandler>;
+#endif
+
+#if deal_II_dimension == 2
+template class DoFObjectAccessor<1, 2, DoFHandler>;
+template class DoFObjectAccessor<2, 2, DoFHandler>;
+
+template class TriaRawIterator <2,DoFObjectAccessor<1, 2, DoFHandler> >;
+template class TriaIterator <2,DoFObjectAccessor<1, 2, DoFHandler> >;
+template class TriaActiveIterator<2,DoFObjectAccessor<1, 2, DoFHandler> >;
+#endif
+
+#if deal_II_dimension == 3
+template class DoFObjectAccessor<1, 3, DoFHandler>;
+template class DoFObjectAccessor<2, 3, DoFHandler>;
+template class DoFObjectAccessor<3, 3, DoFHandler>;
+
+template class TriaRawIterator <3,DoFObjectAccessor<1, 3, DoFHandler> >;
+template class TriaIterator <3,DoFObjectAccessor<1, 3, DoFHandler> >;
+template class TriaActiveIterator<3,DoFObjectAccessor<1, 3, DoFHandler> >;
+template class TriaRawIterator <3,DoFObjectAccessor<2, 3, DoFHandler> >;
+template class TriaIterator <3,DoFObjectAccessor<2, 3, DoFHandler> >;
+template class TriaActiveIterator<3,DoFObjectAccessor<2, 3, DoFHandler> >;
+#endif
+
+
+template class DoFCellAccessor<deal_II_dimension, DoFHandler>;
+
+template class TriaRawIterator <deal_II_dimension,DoFCellAccessor<deal_II_dimension, DoFHandler> >;
+template class TriaIterator <deal_II_dimension,DoFCellAccessor<deal_II_dimension, DoFHandler> >;
+template class TriaActiveIterator<deal_II_dimension,DoFCellAccessor<deal_II_dimension, DoFHandler> >;
+
+
+// --------------------------------------------------------------------------
+// explicit instantiations (for hpDoFHandler)
+
+
+template
+void
+DoFObjectAccessor<1,deal_II_dimension,hpDoFHandler>::get_dof_values<Vector<double>,double>
+(const Vector<double>&, Vector<double>&) const;
+template
+void
+DoFObjectAccessor<1,deal_II_dimension,hpDoFHandler>::set_dof_values<Vector<double>,double>
+(const Vector<double>&, Vector<double>&) const;
+template
+void
+DoFObjectAccessor<1,deal_II_dimension,hpDoFHandler>::get_dof_values<Vector<double>,float>
+(const Vector<double>&, Vector<float>&) const;
+template
+void
+DoFObjectAccessor<1,deal_II_dimension,hpDoFHandler>::set_dof_values<Vector<float>,double>
+(const Vector<double>&, Vector<float>&) const;
+template
+void
+DoFObjectAccessor<1,deal_II_dimension,hpDoFHandler>::get_dof_values<Vector<float>,double>
+(const Vector<float>&, Vector<double>&) const;
+template
+void
+DoFObjectAccessor<1,deal_II_dimension,hpDoFHandler>::set_dof_values<Vector<double>,float>
+(const Vector<float>&, Vector<double>&) const;
+template
+void
+DoFObjectAccessor<1,deal_II_dimension,hpDoFHandler>::get_dof_values<Vector<float>,float>
+(const Vector<float>&, Vector<float>&) const;
+template
+void
+DoFObjectAccessor<1,deal_II_dimension,hpDoFHandler>::set_dof_values<Vector<float>,float>
+(const Vector<float>&, Vector<float>&) const;
+
+
+// for block vector
+template
+void
+DoFObjectAccessor<1,deal_II_dimension,hpDoFHandler>::get_dof_values<BlockVector<double>,double>
+(const BlockVector<double> &, Vector<double>&) const;
+template
+void
+DoFObjectAccessor<1,deal_II_dimension,hpDoFHandler>::set_dof_values<BlockVector<double>,double>
+(const Vector<double>&, BlockVector<double>&) const;
+template
+void
+DoFObjectAccessor<1,deal_II_dimension,hpDoFHandler>::get_dof_values<BlockVector<double>,float>
+(const BlockVector<double> &, Vector<float>&) const;
+template
+void
+DoFObjectAccessor<1,deal_II_dimension,hpDoFHandler>::set_dof_values<BlockVector<float>,double>
+(const Vector<double>&, BlockVector<float>&) const;
+template
+void
+DoFObjectAccessor<1,deal_II_dimension,hpDoFHandler>::get_dof_values<BlockVector<float>,double>
+(const BlockVector<float> &, Vector<double>&) const;
+template
+void
+DoFObjectAccessor<1,deal_II_dimension,hpDoFHandler>::set_dof_values<BlockVector<double>,float>
+(const Vector<float>&, BlockVector<double>&) const;
+template
+void
+DoFObjectAccessor<1,deal_II_dimension,hpDoFHandler>::get_dof_values<BlockVector<float>,float>
+(const BlockVector<float>&, Vector<float>&) const;
+template
+void
+DoFObjectAccessor<1,deal_II_dimension,hpDoFHandler>::set_dof_values<BlockVector<float>,float>
+(const Vector<float>&, BlockVector<float>&) const;
+
+// for Petsc vectors
+#if DEAL_II_USE_PETSC
+template
+void
+DoFObjectAccessor<1,deal_II_dimension,hpDoFHandler>::get_dof_values<PETScWrappers::Vector,double>
+(const PETScWrappers::Vector &, Vector<double>&) const;
+template
+void
+DoFObjectAccessor<1,deal_II_dimension,hpDoFHandler>::get_dof_values<PETScWrappers::Vector,float>
+(const PETScWrappers::Vector &, Vector<float>&) const;
+template
+void
+DoFObjectAccessor<1,deal_II_dimension,hpDoFHandler>::set_dof_values<PETScWrappers::Vector,double>
+(const Vector<double> &, PETScWrappers::Vector&) const;
+template
+void
+DoFObjectAccessor<1,deal_II_dimension,hpDoFHandler>::set_dof_values<PETScWrappers::Vector,float>
+(const Vector<float>&, PETScWrappers::Vector&) const;
+#endif
+
+
+#if deal_II_dimension >= 2
+template
+void
+DoFObjectAccessor<2,deal_II_dimension,hpDoFHandler>::get_dof_values<Vector<double>,double>
+(const Vector<double>&, Vector<double>&) const;
+template
+void
+DoFObjectAccessor<2,deal_II_dimension,hpDoFHandler>::set_dof_values<Vector<double>,double>
+(const Vector<double>&, Vector<double>&) const;
+template
+void
+DoFObjectAccessor<2,deal_II_dimension,hpDoFHandler>::get_dof_values<Vector<double>,float>
+(const Vector<double>&, Vector<float>&) const;
+template
+void
+DoFObjectAccessor<2,deal_II_dimension,hpDoFHandler>::set_dof_values<Vector<float>,double>
+(const Vector<double>&, Vector<float>&) const;
+template
+void
+DoFObjectAccessor<2,deal_II_dimension,hpDoFHandler>::get_dof_values<Vector<float>,double>
+(const Vector<float>&, Vector<double>&) const;
+template
+void
+DoFObjectAccessor<2,deal_II_dimension,hpDoFHandler>::set_dof_values<Vector<double>,float>
+(const Vector<float>&, Vector<double>&) const;
+template
+void
+DoFObjectAccessor<2,deal_II_dimension,hpDoFHandler>::get_dof_values<Vector<float>,float>
+(const Vector<float>&, Vector<float>&) const;
+template
+void
+DoFObjectAccessor<2,deal_II_dimension,hpDoFHandler>::set_dof_values<Vector<float>,float>
+(const Vector<float>&, Vector<float>&) const;
+
+
+// for block vector
+template
+void
+DoFObjectAccessor<2,deal_II_dimension,hpDoFHandler>::get_dof_values<BlockVector<double>,double>
+(const BlockVector<double>&, Vector<double>&) const;
+template
+void
+DoFObjectAccessor<2,deal_II_dimension,hpDoFHandler>::set_dof_values<BlockVector<double>,double>
+(const Vector<double>&, BlockVector<double>&) const;
+template
+void
+DoFObjectAccessor<2,deal_II_dimension,hpDoFHandler>::get_dof_values<BlockVector<double>,float>
+(const BlockVector<double>&, Vector<float>&) const;
+template
+void
+DoFObjectAccessor<2,deal_II_dimension,hpDoFHandler>::set_dof_values<BlockVector<float>,double>
+(const Vector<double>&, BlockVector<float>&) const;
+template
+void
+DoFObjectAccessor<2,deal_II_dimension,hpDoFHandler>::get_dof_values<BlockVector<float>,double>
+(const BlockVector<float>&, Vector<double>&) const;
+template
+void
+DoFObjectAccessor<2,deal_II_dimension,hpDoFHandler>::set_dof_values<BlockVector<double>,float>
+(const Vector<float>&, BlockVector<double>&) const;
+template
+void
+DoFObjectAccessor<2,deal_II_dimension,hpDoFHandler>::get_dof_values<BlockVector<float>,float>
+(const BlockVector<float>&, Vector<float>&) const;
+template
+void
+DoFObjectAccessor<2,deal_II_dimension,hpDoFHandler>::set_dof_values<BlockVector<float>,float>
+(const Vector<float>&, BlockVector<float>&) const;
+
+// for Petsc vectors
+#if DEAL_II_USE_PETSC
+template
+void
+DoFObjectAccessor<2,deal_II_dimension,hpDoFHandler>::get_dof_values<PETScWrappers::Vector,double>
+(const PETScWrappers::Vector &, Vector<double>&) const;
+template
+void
+DoFObjectAccessor<2,deal_II_dimension,hpDoFHandler>::get_dof_values<PETScWrappers::Vector,float>
+(const PETScWrappers::Vector &, Vector<float>&) const;
+template
+void
+DoFObjectAccessor<2,deal_II_dimension,hpDoFHandler>::set_dof_values<PETScWrappers::Vector,double>
+(const Vector<double> &, PETScWrappers::Vector&) const;
+template
+void
+DoFObjectAccessor<2,deal_II_dimension,hpDoFHandler>::set_dof_values<PETScWrappers::Vector,float>
+(const Vector<float>&, PETScWrappers::Vector&) const;
+#endif
+
+#endif
+
#if deal_II_dimension >= 3
// for double
template
void
-DoFObjectAccessor<3,deal_II_dimension>::get_dof_values<Vector<double>,double>
+DoFObjectAccessor<3,deal_II_dimension,hpDoFHandler>::get_dof_values<Vector<double>,double>
(const Vector<double>&, Vector<double>&) const;
template
void
-DoFObjectAccessor<3,deal_II_dimension>::set_dof_values<Vector<double>,double>
+DoFObjectAccessor<3,deal_II_dimension,hpDoFHandler>::set_dof_values<Vector<double>,double>
(const Vector<double>&, Vector<double>&) const;
template
void
-DoFObjectAccessor<3,deal_II_dimension>::get_dof_values<Vector<double>,float>
+DoFObjectAccessor<3,deal_II_dimension,hpDoFHandler>::get_dof_values<Vector<double>,float>
(const Vector<double>&, Vector<float>&) const;
template
void
-DoFObjectAccessor<3,deal_II_dimension>::set_dof_values<Vector<float>,double>
+DoFObjectAccessor<3,deal_II_dimension,hpDoFHandler>::set_dof_values<Vector<float>,double>
(const Vector<double>&, Vector<float>&) const;
template
void
-DoFObjectAccessor<3,deal_II_dimension>::get_dof_values<Vector<float>,double>
+DoFObjectAccessor<3,deal_II_dimension,hpDoFHandler>::get_dof_values<Vector<float>,double>
(const Vector<float>&, Vector<double>&) const;
template
void
-DoFObjectAccessor<3,deal_II_dimension>::set_dof_values<Vector<double>,float>
+DoFObjectAccessor<3,deal_II_dimension,hpDoFHandler>::set_dof_values<Vector<double>,float>
(const Vector<float>&, Vector<double>&) const;
template
void
-DoFObjectAccessor<3,deal_II_dimension>::get_dof_values<Vector<float>,float>
+DoFObjectAccessor<3,deal_II_dimension,hpDoFHandler>::get_dof_values<Vector<float>,float>
(const Vector<float>&, Vector<float>&) const;
template
void
-DoFObjectAccessor<3,deal_II_dimension>::set_dof_values<Vector<float>,float>
+DoFObjectAccessor<3,deal_II_dimension,hpDoFHandler>::set_dof_values<Vector<float>,float>
(const Vector<float>&, Vector<float>&) const;
// for block vector
template
void
-DoFObjectAccessor<3,deal_II_dimension>::get_dof_values<BlockVector<double>,double>
+DoFObjectAccessor<3,deal_II_dimension,hpDoFHandler>::get_dof_values<BlockVector<double>,double>
(const BlockVector<double>&, Vector<double>&) const;
template
void
-DoFObjectAccessor<3,deal_II_dimension>::set_dof_values<BlockVector<double>,double>
+DoFObjectAccessor<3,deal_II_dimension,hpDoFHandler>::set_dof_values<BlockVector<double>,double>
(const Vector<double>&, BlockVector<double>&) const;
template
void
-DoFObjectAccessor<3,deal_II_dimension>::get_dof_values<BlockVector<double>,float>
+DoFObjectAccessor<3,deal_II_dimension,hpDoFHandler>::get_dof_values<BlockVector<double>,float>
(const BlockVector<double>&, Vector<float>&) const;
template
void
-DoFObjectAccessor<3,deal_II_dimension>::set_dof_values<BlockVector<float>,double>
+DoFObjectAccessor<3,deal_II_dimension,hpDoFHandler>::set_dof_values<BlockVector<float>,double>
(const Vector<double>&, BlockVector<float>&) const;
template
void
-DoFObjectAccessor<3,deal_II_dimension>::get_dof_values<BlockVector<float>,double>
+DoFObjectAccessor<3,deal_II_dimension,hpDoFHandler>::get_dof_values<BlockVector<float>,double>
(const BlockVector<float>&, Vector<double>&) const;
template
void
-DoFObjectAccessor<3,deal_II_dimension>::set_dof_values<BlockVector<double>,float>
+DoFObjectAccessor<3,deal_II_dimension,hpDoFHandler>::set_dof_values<BlockVector<double>,float>
(const Vector<float>&, BlockVector<double>&) const;
template
void
-DoFObjectAccessor<3,deal_II_dimension>::get_dof_values<BlockVector<float>,float>
+DoFObjectAccessor<3,deal_II_dimension,hpDoFHandler>::get_dof_values<BlockVector<float>,float>
(const BlockVector<float>&, Vector<float>&) const;
template
void
-DoFObjectAccessor<3,deal_II_dimension>::set_dof_values<BlockVector<float>,float>
+DoFObjectAccessor<3,deal_II_dimension,hpDoFHandler>::set_dof_values<BlockVector<float>,float>
(const Vector<float>&, BlockVector<float>&) const;
+
// for Petsc vectors
#ifdef DEAL_II_USE_PETSC
template
void
-DoFObjectAccessor<3,deal_II_dimension>::get_dof_values<PETScWrappers::Vector,double>
+DoFObjectAccessor<3,deal_II_dimension,hpDoFHandler>::get_dof_values<PETScWrappers::Vector,double>
(const PETScWrappers::Vector &, Vector<double>&) const;
template
void
-DoFObjectAccessor<3,deal_II_dimension>::get_dof_values<PETScWrappers::Vector,float>
+DoFObjectAccessor<3,deal_II_dimension,hpDoFHandler>::get_dof_values<PETScWrappers::Vector,float>
(const PETScWrappers::Vector &, Vector<float>&) const;
template
void
-DoFObjectAccessor<3,deal_II_dimension>::set_dof_values<PETScWrappers::Vector,double>
-(const Vector<double>&, PETScWrappers::Vector &) const;
+DoFObjectAccessor<3,deal_II_dimension,hpDoFHandler>::set_dof_values<PETScWrappers::Vector,double>
+(const Vector<double> &, PETScWrappers::Vector&) const;
template
void
-DoFObjectAccessor<3,deal_II_dimension>::set_dof_values<PETScWrappers::Vector,float>
+DoFObjectAccessor<3,deal_II_dimension,hpDoFHandler>::set_dof_values<PETScWrappers::Vector,float>
(const Vector<float>&, PETScWrappers::Vector&) const;
template
void
-DoFObjectAccessor<3,deal_II_dimension>::get_dof_values<PETScWrappers::BlockVector,double>
+DoFObjectAccessor<3,deal_II_dimension,hpDoFHandler>::get_dof_values<PETScWrappers::BlockVector,double>
(const PETScWrappers::BlockVector &, Vector<double>&) const;
template
void
-DoFObjectAccessor<3,deal_II_dimension>::get_dof_values<PETScWrappers::BlockVector,float>
+DoFObjectAccessor<3,deal_II_dimension,hpDoFHandler>::get_dof_values<PETScWrappers::BlockVector,float>
(const PETScWrappers::BlockVector &, Vector<float>&) const;
template
void
-DoFObjectAccessor<3,deal_II_dimension>::set_dof_values<PETScWrappers::BlockVector,double>
+DoFObjectAccessor<3,deal_II_dimension,hpDoFHandler>::set_dof_values<PETScWrappers::BlockVector,double>
(const Vector<double>&, PETScWrappers::BlockVector &) const;
template
void
-DoFObjectAccessor<3,deal_II_dimension>::set_dof_values<PETScWrappers::BlockVector,float>
+DoFObjectAccessor<3,deal_II_dimension,hpDoFHandler>::set_dof_values<PETScWrappers::BlockVector,float>
(const Vector<float>&, PETScWrappers::BlockVector&) const;
#endif
#endif
template
void
-DoFCellAccessor<deal_II_dimension>::
+DoFCellAccessor<deal_II_dimension,hpDoFHandler>::
get_interpolated_dof_values<Vector<double>,double>
(const Vector<double>&, Vector<double>&) const;
template
void
-DoFCellAccessor<deal_II_dimension>::
+DoFCellAccessor<deal_II_dimension,hpDoFHandler>::
set_dof_values_by_interpolation<Vector<double>,double>
(const Vector<double>&, Vector<double>&) const;
template
void
-DoFCellAccessor<deal_II_dimension>::
+DoFCellAccessor<deal_II_dimension,hpDoFHandler>::
get_interpolated_dof_values<Vector<double>,float>
(const Vector<double>&, Vector<float>&) const;
template
void
-DoFCellAccessor<deal_II_dimension>::
+DoFCellAccessor<deal_II_dimension,hpDoFHandler>::
set_dof_values_by_interpolation<Vector<float>,double>
(const Vector<double>&, Vector<float>&) const;
template
void
-DoFCellAccessor<deal_II_dimension>::
+DoFCellAccessor<deal_II_dimension,hpDoFHandler>::
get_interpolated_dof_values<Vector<float>,double>
(const Vector<float>&, Vector<double>&) const;
template
void
-DoFCellAccessor<deal_II_dimension>::
+DoFCellAccessor<deal_II_dimension,hpDoFHandler>::
set_dof_values_by_interpolation<Vector<double>,float>
(const Vector<float>&, Vector<double>&) const;
template
void
-DoFCellAccessor<deal_II_dimension>::
+DoFCellAccessor<deal_II_dimension,hpDoFHandler>::
get_interpolated_dof_values<Vector<float>,float>
(const Vector<float>&, Vector<float>&) const;
template
void
-DoFCellAccessor<deal_II_dimension>::
+DoFCellAccessor<deal_II_dimension,hpDoFHandler>::
set_dof_values_by_interpolation<Vector<float>,float>
(const Vector<float>&, Vector<float>&) const;
template
void
-DoFCellAccessor<deal_II_dimension>::
+DoFCellAccessor<deal_II_dimension,hpDoFHandler>::
get_interpolated_dof_values<BlockVector<double>,double>
(const BlockVector<double>&, Vector<double>&) const;
template
void
-DoFCellAccessor<deal_II_dimension>::
+DoFCellAccessor<deal_II_dimension,hpDoFHandler>::
set_dof_values_by_interpolation<BlockVector<double>,double>
(const Vector<double>&, BlockVector<double>&) const;
template
void
-DoFCellAccessor<deal_II_dimension>::
+DoFCellAccessor<deal_II_dimension,hpDoFHandler>::
get_interpolated_dof_values<BlockVector<double>,float>
(const BlockVector<double>&, Vector<float>&) const;
template
void
-DoFCellAccessor<deal_II_dimension>::
+DoFCellAccessor<deal_II_dimension,hpDoFHandler>::
set_dof_values_by_interpolation<BlockVector<float>,double>
(const Vector<double>&, BlockVector<float>&) const;
template
void
-DoFCellAccessor<deal_II_dimension>::
+DoFCellAccessor<deal_II_dimension,hpDoFHandler>::
get_interpolated_dof_values<BlockVector<float>,double>
(const BlockVector<float>&, Vector<double>&) const;
template
void
-DoFCellAccessor<deal_II_dimension>::
+DoFCellAccessor<deal_II_dimension,hpDoFHandler>::
set_dof_values_by_interpolation<BlockVector<double>,float>
(const Vector<float>&, BlockVector<double>&) const;
template
void
-DoFCellAccessor<deal_II_dimension>::
+DoFCellAccessor<deal_II_dimension,hpDoFHandler>::
get_interpolated_dof_values<BlockVector<float>,float>
(const BlockVector<float>&, Vector<float>&) const;
template
void
-DoFCellAccessor<deal_II_dimension>::
+DoFCellAccessor<deal_II_dimension,hpDoFHandler>::
set_dof_values_by_interpolation<BlockVector<float>,float>
(const Vector<float>&, BlockVector<float>&) const;
#ifdef DEAL_II_USE_PETSC
template
void
-DoFCellAccessor<deal_II_dimension>::
+DoFCellAccessor<deal_II_dimension,hpDoFHandler>::
get_interpolated_dof_values<PETScWrappers::Vector,double>
(const PETScWrappers::Vector&, Vector<double>&) const;
template
void
-DoFCellAccessor<deal_II_dimension>::
+DoFCellAccessor<deal_II_dimension,hpDoFHandler>::
set_dof_values_by_interpolation<PETScWrappers::Vector,double>
(const Vector<double>&, PETScWrappers::Vector&) const;
template
void
-DoFCellAccessor<deal_II_dimension>::
+DoFCellAccessor<deal_II_dimension,hpDoFHandler>::
get_interpolated_dof_values<PETScWrappers::Vector,float>
(const PETScWrappers::Vector&, Vector<float>&) const;
template
void
-DoFCellAccessor<deal_II_dimension>::
+DoFCellAccessor<deal_II_dimension,hpDoFHandler>::
set_dof_values_by_interpolation<PETScWrappers::Vector,float>
(const Vector<float>&, PETScWrappers::Vector&) const;
+
template
void
-DoFCellAccessor<deal_II_dimension>::
+DoFCellAccessor<deal_II_dimension,hpDoFHandler>::
get_interpolated_dof_values<PETScWrappers::BlockVector,double>
(const PETScWrappers::BlockVector&, Vector<double>&) const;
template
void
-DoFCellAccessor<deal_II_dimension>::
+DoFCellAccessor<deal_II_dimension,hpDoFHandler>::
set_dof_values_by_interpolation<PETScWrappers::BlockVector,double>
(const Vector<double>&, PETScWrappers::BlockVector&) const;
template
void
-DoFCellAccessor<deal_II_dimension>::
+DoFCellAccessor<deal_II_dimension,hpDoFHandler>::
get_interpolated_dof_values<PETScWrappers::BlockVector,float>
(const PETScWrappers::BlockVector&, Vector<float>&) const;
template
void
-DoFCellAccessor<deal_II_dimension>::
+DoFCellAccessor<deal_II_dimension,hpDoFHandler>::
set_dof_values_by_interpolation<PETScWrappers::BlockVector,float>
(const Vector<float>&, PETScWrappers::BlockVector&) const;
#endif
-template class DoFAccessor<deal_II_dimension>;
+template class DoFAccessor<deal_II_dimension, hpDoFHandler>;
#if deal_II_dimension == 1
-template class DoFObjectAccessor<1, 1>;
+template class DoFObjectAccessor<1, 1, hpDoFHandler>;
#endif
#if deal_II_dimension == 2
-template class DoFObjectAccessor<1, 2>;
-template class DoFObjectAccessor<2, 2>;
+template class DoFObjectAccessor<1, 2, hpDoFHandler>;
+template class DoFObjectAccessor<2, 2, hpDoFHandler>;
-template class TriaRawIterator <2,DoFObjectAccessor<1, 2> >;
-template class TriaIterator <2,DoFObjectAccessor<1, 2> >;
-template class TriaActiveIterator<2,DoFObjectAccessor<1, 2> >;
+template class TriaRawIterator <2,DoFObjectAccessor<1, 2, hpDoFHandler> >;
+template class TriaIterator <2,DoFObjectAccessor<1, 2, hpDoFHandler> >;
+template class TriaActiveIterator<2,DoFObjectAccessor<1, 2, hpDoFHandler> >;
#endif
#if deal_II_dimension == 3
-template class DoFObjectAccessor<1, 3>;
-template class DoFObjectAccessor<2, 3>;
-template class DoFObjectAccessor<3, 3>;
-
-template class TriaRawIterator <3,DoFObjectAccessor<1, 3> >;
-template class TriaIterator <3,DoFObjectAccessor<1, 3> >;
-template class TriaActiveIterator<3,DoFObjectAccessor<1, 3> >;
-template class TriaRawIterator <3,DoFObjectAccessor<2, 3> >;
-template class TriaIterator <3,DoFObjectAccessor<2, 3> >;
-template class TriaActiveIterator<3,DoFObjectAccessor<2, 3> >;
+template class DoFObjectAccessor<1, 3, hpDoFHandler>;
+template class DoFObjectAccessor<2, 3, hpDoFHandler>;
+template class DoFObjectAccessor<3, 3, hpDoFHandler>;
+
+template class TriaRawIterator <3,DoFObjectAccessor<1, 3, hpDoFHandler> >;
+template class TriaIterator <3,DoFObjectAccessor<1, 3, hpDoFHandler> >;
+template class TriaActiveIterator<3,DoFObjectAccessor<1, 3, hpDoFHandler> >;
+template class TriaRawIterator <3,DoFObjectAccessor<2, 3, hpDoFHandler> >;
+template class TriaIterator <3,DoFObjectAccessor<2, 3, hpDoFHandler> >;
+template class TriaActiveIterator<3,DoFObjectAccessor<2, 3, hpDoFHandler> >;
#endif
-template class DoFCellAccessor<deal_II_dimension>;
+template class DoFCellAccessor<deal_II_dimension, hpDoFHandler>;
+
+template class TriaRawIterator <deal_II_dimension,DoFCellAccessor<deal_II_dimension, hpDoFHandler> >;
+template class TriaIterator <deal_II_dimension,DoFCellAccessor<deal_II_dimension, hpDoFHandler> >;
+template class TriaActiveIterator<deal_II_dimension,DoFCellAccessor<deal_II_dimension, hpDoFHandler> >;
-template class TriaRawIterator <deal_II_dimension,DoFCellAccessor<deal_II_dimension> >;
-template class TriaIterator <deal_II_dimension,DoFCellAccessor<deal_II_dimension> >;
-template class TriaActiveIterator<deal_II_dimension,DoFCellAccessor<deal_II_dimension> >;
template <>
-DoFDimensionInfo<1>::raw_face_iterator
+DoFHandler<1>::raw_face_iterator
DoFHandler<1>::begin_raw_face (const unsigned int) const
{
Assert (false, ExcImpossibleInDim(1));
template <>
-DoFDimensionInfo<1>::face_iterator
+DoFHandler<1>::face_iterator
DoFHandler<1>::begin_face (const unsigned int) const
{
Assert (false, ExcImpossibleInDim(1));
template <>
-DoFDimensionInfo<1>::active_face_iterator
+DoFHandler<1>::active_face_iterator
DoFHandler<1>::begin_active_face (const unsigned int) const
{
Assert (false, ExcImpossibleInDim(1));
template <>
-DoFDimensionInfo<1>::raw_face_iterator
+DoFHandler<1>::raw_face_iterator
DoFHandler<1>::end_face () const
{
Assert (false, ExcImpossibleInDim(1));
template <>
-DoFDimensionInfo<1>::raw_face_iterator
-DoFHandler<1>::last_raw_face () const
+DoFHandler<1>::raw_face_iterator
+DoFHandler<1>::last_raw_face () const
{
Assert (false, ExcImpossibleInDim(1));
return 0;
template <>
-DoFDimensionInfo<1>::raw_face_iterator
+DoFHandler<1>::raw_face_iterator
DoFHandler<1>::last_raw_face (const unsigned int) const
{
Assert (false, ExcImpossibleInDim(1));
template <>
-DoFDimensionInfo<1>::face_iterator
+DoFHandler<1>::face_iterator
DoFHandler<1>::last_face () const
{
Assert (false, ExcImpossibleInDim(1));
template <>
-DoFDimensionInfo<1>::face_iterator
+DoFHandler<1>::face_iterator
DoFHandler<1>::last_face (const unsigned int) const
{
Assert (false, ExcImpossibleInDim(1));
template <>
-DoFDimensionInfo<1>::active_face_iterator
+DoFHandler<1>::active_face_iterator
DoFHandler<1>::last_active_face () const
{
Assert (false, ExcImpossibleInDim(1));
template <>
-DoFDimensionInfo<1>::active_face_iterator
+DoFHandler<1>::active_face_iterator
DoFHandler<1>::last_active_face (const unsigned int) const
{
return 0;
template <>
-DoFDimensionInfo<2>::raw_face_iterator
+DoFHandler<2>::raw_face_iterator
DoFHandler<2>::begin_raw_face (const unsigned int level) const
{
return begin_raw_line (level);
template <>
-DoFDimensionInfo<2>::face_iterator
+DoFHandler<2>::face_iterator
DoFHandler<2>::begin_face (const unsigned int level) const
{
return begin_line (level);
template <>
-DoFDimensionInfo<2>::active_face_iterator
+DoFHandler<2>::active_face_iterator
DoFHandler<2>::begin_active_face (const unsigned int level) const
{
return begin_active_line (level);
template <>
-DoFDimensionInfo<2>::raw_face_iterator
+DoFHandler<2>::raw_face_iterator
DoFHandler<2>::end_face () const
{
return end_line ();
template <>
-DoFDimensionInfo<2>::raw_face_iterator
+DoFHandler<2>::raw_face_iterator
DoFHandler<2>::last_raw_face () const
{
return last_raw_line ();
template <>
-DoFDimensionInfo<2>::raw_face_iterator
+DoFHandler<2>::raw_face_iterator
DoFHandler<2>::last_raw_face (const unsigned int level) const
{
return last_raw_line (level);
template <>
-DoFDimensionInfo<2>::face_iterator
+DoFHandler<2>::face_iterator
DoFHandler<2>::last_face () const
{
return last_line ();
template <>
-DoFDimensionInfo<2>::face_iterator
+DoFHandler<2>::face_iterator
DoFHandler<2>::last_face (const unsigned int level) const
{
return last_line (level);
template <>
-DoFDimensionInfo<2>::active_face_iterator
+DoFHandler<2>::active_face_iterator
DoFHandler<2>::last_active_face () const
{
return last_active_line ();
template <>
-DoFDimensionInfo<2>::active_face_iterator
+DoFHandler<2>::active_face_iterator
DoFHandler<2>::last_active_face (const unsigned int level) const
{
return last_active_line (level);
template <int dim>
-typename DoFDimensionInfo<dim>::raw_cell_iterator
+typename DoFHandler<dim>::raw_cell_iterator
DoFHandler<dim>::end_raw (const unsigned int level) const
{
return (level == levels.size()-1 ?
template <int dim>
-typename DoFDimensionInfo<dim>::cell_iterator
+typename DoFHandler<dim>::cell_iterator
DoFHandler<dim>::end (const unsigned int level) const
{
return (level == levels.size()-1 ?
template <int dim>
-typename DoFDimensionInfo<dim>::active_cell_iterator
+typename DoFHandler<dim>::active_cell_iterator
DoFHandler<dim>::end_active (const unsigned int level) const
{
return (level == levels.size()-1 ?
template <int dim>
-typename DoFDimensionInfo<dim>::raw_face_iterator
+typename DoFHandler<dim>::raw_face_iterator
DoFHandler<dim>::end_raw_face (const unsigned int level) const
{
return (level == levels.size()-1 ?
template <int dim>
-typename DoFDimensionInfo<dim>::face_iterator
+typename DoFHandler<dim>::face_iterator
DoFHandler<dim>::end_face (const unsigned int level) const
{
return (level == levels.size()-1 ?
template <int dim>
-typename DoFDimensionInfo<dim>::active_face_iterator
+typename DoFHandler<dim>::active_face_iterator
DoFHandler<dim>::end_active_face (const unsigned int level) const
{
return (level == levels.size()-1 ?
template <int dim>
-typename DoFDimensionInfo<dim>::raw_line_iterator
+typename DoFHandler<dim>::raw_line_iterator
DoFHandler<dim>::end_raw_line (const unsigned int level) const
{
return (level == levels.size()-1 ?
template <int dim>
-typename DoFDimensionInfo<dim>::line_iterator
+typename DoFHandler<dim>::line_iterator
DoFHandler<dim>::end_line (const unsigned int level) const
{
return (level == levels.size()-1 ?
template <int dim>
-typename DoFDimensionInfo<dim>::active_line_iterator
+typename DoFHandler<dim>::active_line_iterator
DoFHandler<dim>::end_active_line (const unsigned int level) const
{
return (level == levels.size()-1 ?
template <int dim>
-typename DoFDimensionInfo<dim>::raw_quad_iterator
+typename DoFHandler<dim>::raw_quad_iterator
DoFHandler<dim>::end_raw_quad (const unsigned int level) const
{
return (level == levels.size()-1 ?
template <int dim>
-typename DoFDimensionInfo<dim>::quad_iterator
+typename DoFHandler<dim>::quad_iterator
DoFHandler<dim>::end_quad (const unsigned int level) const
{
return (level == levels.size()-1 ?
template <int dim>
-typename DoFDimensionInfo<dim>::active_quad_iterator
+typename DoFHandler<dim>::active_quad_iterator
DoFHandler<dim>::end_active_quad (const unsigned int level) const
{
return (level == levels.size()-1 ?
template <int dim>
-typename DoFDimensionInfo<dim>::raw_hex_iterator
+typename DoFHandler<dim>::raw_hex_iterator
DoFHandler<dim>::end_raw_hex (const unsigned int level) const
{
return (level == levels.size()-1 ?
template <int dim>
-typename DoFDimensionInfo<dim>::hex_iterator
+typename DoFHandler<dim>::hex_iterator
DoFHandler<dim>::end_hex (const unsigned int level) const
{
return (level == levels.size()-1 ?
template <int dim>
-typename DoFDimensionInfo<dim>::active_hex_iterator
+typename DoFHandler<dim>::active_hex_iterator
DoFHandler<dim>::end_active_hex (const unsigned int level) const
{
return (level == levels.size()-1 ?
}
-
-template <int dim>
-const Triangulation<dim> & DoFHandler<dim>::get_tria () const
-{
- return *tria;
-}
-
-
-
template <int dim>
unsigned int
DoFHandler<dim>::memory_consumption () const
#if deal_II_dimension == 1
template <>
-unsigned int DoFHandler<1>::distribute_dofs_on_cell (active_cell_iterator &cell,
- unsigned int next_free_dof) {
+unsigned int
+DoFHandler<1>::distribute_dofs_on_cell (active_cell_iterator &cell,
+ unsigned int next_free_dof)
+{
// distribute dofs of vertices
for (unsigned int v=0; v<GeometryInfo<1>::vertices_per_cell; ++v)
#if deal_II_dimension == 2
template <>
-unsigned int DoFHandler<2>::distribute_dofs_on_cell (active_cell_iterator &cell,
- unsigned int next_free_dof) {
+unsigned int
+DoFHandler<2>::distribute_dofs_on_cell (active_cell_iterator &cell,
+ unsigned int next_free_dof)
+{
if (selected_fe->dofs_per_vertex > 0)
// number dofs on vertices
for (unsigned int vertex=0; vertex<GeometryInfo<2>::vertices_per_cell; ++vertex)
#if deal_II_dimension == 3
template <>
-unsigned int DoFHandler<3>::distribute_dofs_on_cell (active_cell_iterator &cell,
- unsigned int next_free_dof) {
+unsigned int
+DoFHandler<3>::distribute_dofs_on_cell (active_cell_iterator &cell,
+ unsigned int next_free_dof)
+{
if (selected_fe->dofs_per_vertex > 0)
// number dofs on vertices
for (unsigned int vertex=0; vertex<GeometryInfo<3>::vertices_per_cell; ++vertex)
#if deal_II_dimension == 1
template <>
-unsigned int DoFHandler<1>::max_couplings_between_dofs () const
+unsigned int
+DoFHandler<1>::max_couplings_between_dofs () const
{
Assert (selected_fe != 0, ExcNoFESelected());
return std::min(3*selected_fe->dofs_per_vertex +
template <>
-unsigned int DoFHandler<1>::max_couplings_between_boundary_dofs () const
+unsigned int
+DoFHandler<1>::max_couplings_between_boundary_dofs () const
{
Assert (selected_fe != 0, ExcNoFESelected());
return selected_fe->dofs_per_vertex;
#if deal_II_dimension == 2
template <>
-unsigned int DoFHandler<2>::max_couplings_between_dofs () const
+unsigned int
+DoFHandler<2>::max_couplings_between_dofs () const
{
Assert (selected_fe != 0, ExcNoFESelected());
template <>
-unsigned int DoFHandler<2>::max_couplings_between_boundary_dofs () const
+unsigned int
+DoFHandler<2>::max_couplings_between_boundary_dofs () const
{
Assert (selected_fe != 0, ExcNoFESelected());
return 3*selected_fe->dofs_per_vertex + 2*selected_fe->dofs_per_line;
#if deal_II_dimension == 3
template <>
-unsigned int DoFHandler<3>::max_couplings_between_dofs () const
+unsigned int
+DoFHandler<3>::max_couplings_between_dofs () const
{
//TODO:[?] Invent significantly better estimates than the ones in this function
Assert (selected_fe != 0, ExcNoFESelected());
template <>
-unsigned int DoFHandler<3>::max_couplings_between_boundary_dofs () const {
+unsigned int
+DoFHandler<3>::max_couplings_between_boundary_dofs () const
+{
Assert (selected_fe != 0, ExcNoFESelected());
// we need to take refinement of
// one boundary face into consideration
#include <dofs/dof_levels.h>
-unsigned int
-DoFLevel<1>::memory_consumption () const
+namespace internal
{
- return MemoryConsumption::memory_consumption (line_dofs);
-}
+
+ unsigned int
+ DoFLevel<1>::memory_consumption () const
+ {
+ return MemoryConsumption::memory_consumption (line_dofs);
+ }
-unsigned int
-DoFLevel<2>::memory_consumption () const
-{
- return (DoFLevel<1>::memory_consumption () +
- MemoryConsumption::memory_consumption (quad_dofs));
-}
+ unsigned int
+ DoFLevel<2>::memory_consumption () const
+ {
+ return (DoFLevel<1>::memory_consumption () +
+ MemoryConsumption::memory_consumption (quad_dofs));
+ }
-unsigned int
-DoFLevel<3>::memory_consumption () const
-{
- return (DoFLevel<2>::memory_consumption () +
- MemoryConsumption::memory_consumption (hex_dofs));
+ unsigned int
+ DoFLevel<3>::memory_consumption () const
+ {
+ return (DoFLevel<2>::memory_consumption () +
+ MemoryConsumption::memory_consumption (hex_dofs));
+ }
}
-template <int dim>
+template <int dim, template <int> class DH>
void
DoFRenumbering::
-Cuthill_McKee (DoFHandler<dim> &dof_handler,
+Cuthill_McKee (DH<dim> &dof_handler,
const bool reversed_numbering,
const bool use_constraints,
const std::vector<unsigned int> &starting_indices)
-template <int dim>
+template <int dim, template <int> class DH>
void
DoFRenumbering::
compute_Cuthill_McKee (std::vector<unsigned int>& new_indices,
- const DoFHandler<dim>& dof_handler,
+ const DH<dim>& dof_handler,
const bool reversed_numbering,
const bool use_constraints,
const std::vector<unsigned int>& starting_indices)
const ENDITERATOR& end,
const std::vector<unsigned int> &component_order_arg)
{
-// Modify for hp
+//TODO: Modify for hp
const FiniteElement<dim>& fe = start->get_fe();
const unsigned int dofs_per_cell = fe.dofs_per_cell;
// explicit instantiations
template
-void DoFRenumbering::Cuthill_McKee<deal_II_dimension>
+void DoFRenumbering::Cuthill_McKee<deal_II_dimension, DoFHandler>
(DoFHandler<deal_II_dimension>&,
const bool,
const bool,
template
void
-DoFRenumbering::compute_Cuthill_McKee<deal_II_dimension>
+DoFRenumbering::compute_Cuthill_McKee<deal_II_dimension, DoFHandler>
(std::vector<unsigned int>&,
const DoFHandler<deal_II_dimension>&,
const bool,
const bool,
const std::vector<unsigned int>&);
+
+template
+void DoFRenumbering::Cuthill_McKee<deal_II_dimension, hpDoFHandler>
+(hpDoFHandler<deal_II_dimension>&,
+ const bool,
+ const bool,
+ const std::vector<unsigned int>&);
+
+template
+void
+DoFRenumbering::compute_Cuthill_McKee<deal_II_dimension, hpDoFHandler>
+(std::vector<unsigned int>&,
+ const hpDoFHandler<deal_II_dimension>&,
+ const bool,
+ const bool,
+ const std::vector<unsigned int>&);
+
+
template
void DoFRenumbering::component_wise<deal_II_dimension>
(DoFHandler<deal_II_dimension>&,
#include <numeric>
+namespace
+{
+ // Functions for the DoFHandler
+ template <int dim>
+ unsigned int
+ max_dofs_per_cell (const DoFHandler<dim> &dh)
+ {
+ return dh.get_fe().dofs_per_cell;
+ }
+
+
+
+ template <int dim>
+ unsigned int
+ max_dofs_per_face (const DoFHandler<dim> &dh)
+ {
+ return dh.get_fe().dofs_per_face;
+ }
+
+
+
+ template <int dim>
+ unsigned int
+ max_dofs_per_vertex (const DoFHandler<dim> &dh)
+ {
+ return dh.get_fe().dofs_per_vertex;
+ }
+
+
+
+ template <int dim>
+ unsigned int
+ n_components (const DoFHandler<dim> &dh)
+ {
+ return dh.get_fe().n_components();
+ }
+
+
+
+ template <int dim>
+ unsigned int
+ fe_is_primitive (const DoFHandler<dim> &dh)
+ {
+ return dh.get_fe().is_primitive();
+ }
+
+ // Functions for the hpDoFHandler
+ template <int dim>
+ unsigned int
+ max_dofs_per_cell (const hpDoFHandler<dim> &dh)
+ {
+ return dh.get_fe().max_dofs_per_cell ();
+ }
+
+
+
+ template <int dim>
+ unsigned int
+ max_dofs_per_face (const hpDoFHandler<dim> &dh)
+ {
+ return dh.get_fe().max_dofs_per_face ();
+ }
+
+
+
+ template <int dim>
+ unsigned int
+ max_dofs_per_vertex (const hpDoFHandler<dim> &dh)
+ {
+ return dh.get_fe().max_dofs_per_vertex ();
+ }
+
+
+
+ template <int dim>
+ unsigned int
+ n_components (const hpDoFHandler<dim> &dh)
+ {
+//TODO:[?] Verify that this is really correct
+ return dh.get_fe().get_fe(0).n_components();
+ }
+
+
+
+ template <int dim>
+ unsigned int
+ fe_is_primitive (const hpDoFHandler<dim> &dh)
+ {
+//TODO:[?] Verify that this is really correct
+ return dh.get_fe().get_fe(0).is_primitive();
+ }
+}
+
+
#if deal_II_dimension == 1
-template <int dim, class SparsityPattern>
+template <int dim, class SparsityPattern, template <int> class DH>
void
DoFTools::make_sparsity_pattern (
- const DoFHandler<dim> &dof,
- SparsityPattern &sparsity)
+ const DH<dim> &dof,
+ SparsityPattern &sparsity)
{
const unsigned int n_dofs = dof.n_dofs();
Assert (sparsity.n_cols() == n_dofs,
ExcDimensionMismatch (sparsity.n_cols(), n_dofs));
- const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell;
- std::vector<unsigned int> dofs_on_this_cell(dofs_per_cell);
- typename DoFHandler<dim>::active_cell_iterator cell = dof.begin_active(),
- endc = dof.end();
+ std::vector<unsigned int> dofs_on_this_cell;
+ dofs_on_this_cell.reserve (max_dofs_per_cell(dof));
+ typename DH<dim>::active_cell_iterator cell = dof.begin_active(),
+ endc = dof.end();
for (; cell!=endc; ++cell)
{
+ const unsigned int dofs_per_cell = cell->get_fe().dofs_per_cell;
+ dofs_on_this_cell.resize (dofs_per_cell);
cell->get_dof_indices (dofs_on_this_cell);
// make sparsity pattern for this cell
for (unsigned int i=0; i<dofs_per_cell; ++i)
#if deal_II_dimension == 1
-template <class SparsityPattern>
+template <class SparsityPattern, template <int> class DH>
void
DoFTools::make_boundary_sparsity_pattern (
- const DoFHandler<1> &dof_handler,
+ const DH<1> &dof_handler,
const FunctionMap<1>::type &function_map,
const std::vector<unsigned int> &dof_to_boundary_mapping,
SparsityPattern &sparsity)
{
- const unsigned int dofs_per_vertex = dof_handler.get_fe().dofs_per_vertex;
- std::vector<unsigned int> boundary_dof_boundary_indices (dofs_per_vertex);
-
// first check left, the right
// boundary point
for (unsigned int direction=0; direction<2; ++direction)
// find active cell at that
// boundary: first go to
// left/right, then to children
- DoFHandler<1>::cell_iterator cell = dof_handler.begin(0);
+ typename DH<1>::cell_iterator cell = dof_handler.begin(0);
while (!cell->at_boundary(direction))
cell = cell->neighbor(direction);
while (!cell->active())
cell = cell->child(direction);
+ const unsigned int dofs_per_vertex = cell->get_fe().dofs_per_vertex;
+ std::vector<unsigned int> boundary_dof_boundary_indices (dofs_per_vertex);
+
// next get boundary mapped dof
// indices of boundary dofs
for (unsigned int i=0; i<dofs_per_vertex; ++i)
-template <class SparsityPattern>
+template <class SparsityPattern, template <int> class DH>
void DoFTools::make_boundary_sparsity_pattern (
- const DoFHandler<1> &dof_handler,
- const std::vector<unsigned int> &dof_to_boundary_mapping,
+ const DH<1> &dof_handler,
+ const std::vector<unsigned int> &dof_to_boundary_mapping,
SparsityPattern &sparsity)
{
// there are only 2 boundary
// indicators in 1d, so it is no
// performance problem to call the
// other function
- DoFHandler<1>::FunctionMap boundary_indicators;
+ typename DH<1>::FunctionMap boundary_indicators;
boundary_indicators[0] = 0;
boundary_indicators[1] = 0;
- make_boundary_sparsity_pattern (dof_handler, boundary_indicators,
- dof_to_boundary_mapping, sparsity);
+ make_boundary_sparsity_pattern<SparsityPattern> (dof_handler,
+ boundary_indicators,
+ dof_to_boundary_mapping,
+ sparsity);
}
#endif
-template <int dim, class SparsityPattern>
+template <int dim, class SparsityPattern, template <int> class DH>
void
DoFTools::make_boundary_sparsity_pattern (
- const DoFHandler<dim>& dof,
- const std::vector<unsigned int> &dof_to_boundary_mapping,
+ const DH<dim> &dof,
+ const std::vector<unsigned int> &dof_to_boundary_mapping,
SparsityPattern &sparsity)
{
const unsigned int n_dofs = dof.n_dofs();
unsigned int max_element = 0;
for (std::vector<unsigned int>::const_iterator i=dof_to_boundary_mapping.begin();
i!=dof_to_boundary_mapping.end(); ++i)
- if ((*i != DoFHandler<dim>::invalid_dof_index) &&
+ if ((*i != DH<dim>::invalid_dof_index) &&
(*i > max_element))
max_element = *i;
Assert (max_element == sparsity.n_rows()-1,
};
#endif
- const unsigned int dofs_per_face = dof.get_fe().dofs_per_face;
- std::vector<unsigned int> dofs_on_this_face(dofs_per_face);
+ std::vector<unsigned int> dofs_on_this_face;
+ dofs_on_this_face.reserve (max_dofs_per_face(dof));
// loop over all faces to check
// whether they are at a
// boundaries of dimension dim-2,
// and so every boundary line is
// also part of a boundary face.
- typename DoFHandler<dim>::active_face_iterator face = dof.begin_active_face(),
- endf = dof.end_face();
+ typename DH<dim>::active_face_iterator face = dof.begin_active_face(),
+ endf = dof.end_face();
for (; face!=endf; ++face)
if (face->at_boundary())
{
+ const unsigned int dofs_per_face = face->get_fe().dofs_per_face;
+ dofs_on_this_face.resize (dofs_per_face);
face->get_dof_indices (dofs_on_this_face);
// make sparsity pattern for this cell
-template <int dim, class SparsityPattern>
+template <int dim, class SparsityPattern, template <int> class DH>
void DoFTools::make_boundary_sparsity_pattern (
- const DoFHandler<dim>& dof,
+ const DH<dim> &dof,
const typename FunctionMap<dim>::type &boundary_indicators,
const std::vector<unsigned int> &dof_to_boundary_mapping,
SparsityPattern &sparsity)
Assert (dof_to_boundary_mapping.size() == n_dofs, ExcInternalError());
Assert (boundary_indicators.find(255) == boundary_indicators.end(),
typename DoFHandler<dim>::ExcInvalidBoundaryIndicator());
- Assert (sparsity.n_rows() == dof.n_boundary_dofs(boundary_indicators),
- ExcDimensionMismatch (sparsity.n_rows(), dof.n_boundary_dofs(boundary_indicators)));
- Assert (sparsity.n_cols() == dof.n_boundary_dofs(boundary_indicators),
- ExcDimensionMismatch (sparsity.n_cols(), dof.n_boundary_dofs(boundary_indicators)));
+ Assert (sparsity.n_rows() == dof.n_boundary_dofs (boundary_indicators),
+ ExcDimensionMismatch (sparsity.n_rows(), dof.n_boundary_dofs (boundary_indicators)));
+ Assert (sparsity.n_cols() == dof.n_boundary_dofs (boundary_indicators),
+ ExcDimensionMismatch (sparsity.n_cols(), dof.n_boundary_dofs (boundary_indicators)));
#ifdef DEBUG
if (true)
{
unsigned int max_element = 0;
for (std::vector<unsigned int>::const_iterator i=dof_to_boundary_mapping.begin();
i!=dof_to_boundary_mapping.end(); ++i)
- if ((*i != DoFHandler<dim>::invalid_dof_index) &&
+ if ((*i != DH<dim>::invalid_dof_index) &&
(*i > max_element))
max_element = *i;
Assert (max_element == sparsity.n_rows()-1,
};
#endif
- const unsigned int dofs_per_face = dof.get_fe().dofs_per_face;
- std::vector<unsigned int> dofs_on_this_face(dofs_per_face);
- typename DoFHandler<dim>::active_face_iterator face = dof.begin_active_face(),
- endf = dof.end_face();
+ std::vector<unsigned int> dofs_on_this_face;
+ dofs_on_this_face.reserve (max_dofs_per_face(dof));
+ typename DH<dim>::active_face_iterator face = dof.begin_active_face(),
+ endf = dof.end_face();
for (; face!=endf; ++face)
if (boundary_indicators.find(face->boundary_indicator()) !=
boundary_indicators.end())
{
+ const unsigned int dofs_per_face = face->get_fe().dofs_per_face;
+ dofs_on_this_face.resize (dofs_per_face);
face->get_dof_indices (dofs_on_this_face);
// make sparsity pattern for this cell
-template <int dim, class SparsityPattern>
+template <int dim, class SparsityPattern, template <int> class DH>
void
DoFTools::make_flux_sparsity_pattern (
- const DoFHandler<dim> &dof,
- SparsityPattern &sparsity)
+ const DH<dim> &dof,
+ SparsityPattern &sparsity)
{
const unsigned int n_dofs = dof.n_dofs();
Assert (sparsity.n_cols() == n_dofs,
ExcDimensionMismatch (sparsity.n_cols(), n_dofs));
- const unsigned int total_dofs = dof.get_fe().dofs_per_cell;
- std::vector<unsigned int> dofs_on_this_cell(total_dofs);
- std::vector<unsigned int> dofs_on_other_cell(total_dofs);
- typename DoFHandler<dim>::active_cell_iterator cell = dof.begin_active(),
- endc = dof.end();
+ std::vector<unsigned int> dofs_on_this_cell;
+ std::vector<unsigned int> dofs_on_other_cell;
+ dofs_on_this_cell.reserve (max_dofs_per_cell(dof));
+ dofs_on_other_cell.reserve (max_dofs_per_cell(dof));
+ typename DH<dim>::active_cell_iterator cell = dof.begin_active(),
+ endc = dof.end();
// Clear user flags because we will
// need them. But first we save
for (; cell!=endc; ++cell)
{
+ const unsigned int n_dofs_on_this_cell = cell->get_fe().dofs_per_cell;
+ dofs_on_this_cell.resize (n_dofs_on_this_cell);
cell->get_dof_indices (dofs_on_this_cell);
// make sparsity pattern for this cell
- for (unsigned int i=0; i<total_dofs; ++i)
- for (unsigned int j=0; j<total_dofs; ++j)
+ for (unsigned int i=0; i<n_dofs_on_this_cell; ++i)
+ for (unsigned int j=0; j<n_dofs_on_this_cell; ++j)
sparsity.add (dofs_on_this_cell[i],
dofs_on_this_cell[j]);
face < GeometryInfo<dim>::faces_per_cell;
++face)
{
- typename DoFHandler<dim>::face_iterator cell_face = cell->face(face);
+ typename DH<dim>::face_iterator cell_face = cell->face(face);
if (cell_face->user_flag_set ())
continue;
if (! cell->at_boundary (face) )
{
- typename DoFHandler<dim>::cell_iterator
- neighbor = cell->neighbor(face);
+ typename DH<dim>::cell_iterator neighbor = cell->neighbor(face);
// Refinement edges are
// taken care of by
// coarser cells
sub_nr != GeometryInfo<dim>::subfaces_per_face;
++sub_nr)
{
- const typename DoFHandler<dim>::cell_iterator
+ const typename DH<dim>::cell_iterator
sub_neighbor
= cell->neighbor_child_on_subface (face, sub_nr);
+ const unsigned int n_dofs_on_neighbor
+ = sub_neighbor->get_fe().dofs_per_cell;
+ dofs_on_other_cell.resize (n_dofs_on_neighbor);
sub_neighbor->get_dof_indices (dofs_on_other_cell);
- for (unsigned int i=0; i<total_dofs; ++i)
- for (unsigned int j=0; j<total_dofs; ++j)
+
+ for (unsigned int i=0; i<n_dofs_on_this_cell; ++i)
+ for (unsigned int j=0; j<n_dofs_on_neighbor; ++j)
{
sparsity.add (dofs_on_this_cell[i],
dofs_on_other_cell[j]);
- sparsity.add (dofs_on_other_cell[i],
- dofs_on_this_cell[j]);
+ sparsity.add (dofs_on_other_cell[j],
+ dofs_on_this_cell[i]);
}
-
sub_neighbor->face(neighbor_face)->set_user_flag ();
}
}
else
{
- neighbor->get_dof_indices (dofs_on_other_cell);
- for (unsigned int i=0; i<total_dofs; ++i)
- for (unsigned int j=0; j<total_dofs; ++j)
+ const unsigned int n_dofs_on_neighbor
+ = neighbor->get_fe().dofs_per_cell;
+ dofs_on_other_cell.resize (n_dofs_on_neighbor);
+
+ neighbor->get_dof_indices (dofs_on_other_cell);
+ for (unsigned int i=0; i<n_dofs_on_this_cell; ++i)
+ for (unsigned int j=0; j<n_dofs_on_neighbor; ++j)
{
sparsity.add (dofs_on_this_cell[i],
dofs_on_other_cell[j]);
- sparsity.add (dofs_on_other_cell[i],
- dofs_on_this_cell[j]);
+ sparsity.add (dofs_on_other_cell[j],
+ dofs_on_this_cell[i]);
}
-
neighbor->face(neighbor_face)->set_user_flag ();
}
}
#if deal_II_dimension == 1
-template <class SparsityPattern>
+template <class SparsityPattern, template <int> class DH>
void
DoFTools::make_flux_sparsity_pattern (
- const DoFHandler<1> &dof,
+ const DH<1> &dof,
SparsityPattern &sparsity)
{
- typedef DoFHandler<1>::cell_iterator cell_iterator;
- typedef DoFHandler<1>::active_cell_iterator active_cell_iterator;
+ typedef typename DH<1>::cell_iterator cell_iterator;
+ typedef typename DH<1>::active_cell_iterator active_cell_iterator;
- const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell;
- std::vector<unsigned int> local_dof_indices (dofs_per_cell);
- std::vector<unsigned int> neighbor_dof_indices (dofs_per_cell);
+ std::vector<unsigned int> local_dof_indices;
+ std::vector<unsigned int> neighbor_dof_indices;
+ local_dof_indices.reserve (max_dofs_per_cell(dof));
+ neighbor_dof_indices.reserve (max_dofs_per_cell(dof));
active_cell_iterator cell = dof.begin_active(),
endc = dof.end();
{
// first do couplings of dofs
// locally on this cell
+ const unsigned int n_dofs_on_this_cell = cell->get_fe().dofs_per_cell;
+ local_dof_indices.resize (n_dofs_on_this_cell);
cell->get_dof_indices (local_dof_indices);
- for (unsigned int i=0; i<dofs_per_cell; ++i)
- for (unsigned int j=0; j<dofs_per_cell; ++j)
+ for (unsigned int i=0; i<n_dofs_on_this_cell; ++i)
+ for (unsigned int j=0; j<n_dofs_on_this_cell; ++j)
sparsity.add (local_dof_indices[i], local_dof_indices[j]);
// then do the same for the up
neighbor = neighbor->child(nb==0 ? 1 : 0);
// get dofs on it
+ const unsigned int n_dofs_on_neighbor
+ = neighbor->get_fe().dofs_per_cell;
+ neighbor_dof_indices.resize (n_dofs_on_neighbor);
neighbor->get_dof_indices (neighbor_dof_indices);
// compute couplings
- for (unsigned int i=0; i<dofs_per_cell; ++i)
- for (unsigned int j=0; j<dofs_per_cell; ++j)
+ for (unsigned int i=0; i<n_dofs_on_this_cell; ++i)
+ for (unsigned int j=0; j<n_dofs_on_neighbor; ++j)
sparsity.add (local_dof_indices[i], neighbor_dof_indices[j]);
};
};
// nothing to be done here
}
+
+void DoFTools::make_hanging_node_constraints (
+ const hpDoFHandler<1> &,
+ ConstraintMatrix &)
+{
+ // nothing to be done here
+}
+
#endif
};
}
+
+void DoFTools::make_hanging_node_constraints (
+ const hpDoFHandler<2> &/*dof_handler*/,
+ ConstraintMatrix &/*constraints*/)
+{
+//TODO[?]: Implement (required for continuous elements)
+ Assert (false, ExcNotImplemented());
+}
+
#endif
};
}
+
+void DoFTools::make_hanging_node_constraints (
+ const hpDoFHandler<3> &/*dof_handler*/,
+ ConstraintMatrix &/*constraints*/)
+{
+//TODO:[?] Implement (required for continuous elements)
+ Assert (false, ExcNotImplemented());
+}
+
#endif
-template <int dim, typename Number>
+template <int dim, typename Number, template <int> class DH>
void DoFTools::distribute_cell_to_dof_vector (
- const DoFHandler<dim> &dof_handler,
- const Vector<Number> &cell_data,
- Vector<double> &dof_data,
- const unsigned int component)
+ const DH<dim> &dof_handler,
+ const Vector<Number> &cell_data,
+ Vector<double> &dof_data,
+ const unsigned int component)
{
const Triangulation<dim> &tria = dof_handler.get_tria();
- const FiniteElement<dim> &fe = dof_handler.get_fe();
Assert (cell_data.size()==tria.n_active_cells(),
ExcWrongSize (cell_data.size(), tria.n_active_cells()));
Assert (dof_data.size()==dof_handler.n_dofs(),
ExcWrongSize (dof_data.size(), dof_handler.n_dofs()));
- Assert (component < fe.n_components(),
- ExcInvalidComponent(component, fe.n_components()));
- Assert (fe.is_primitive() == true,
+ Assert (component < n_components(dof_handler),
+ ExcInvalidComponent(component, n_components(dof_handler)));
+ Assert (fe_is_primitive(dof_handler) == true,
ExcFENotPrimitive());
// store a flag whether we should care
// just a simplification, we could ask
// for this at every single place
// equally well
- const bool consider_components = (fe.n_components() != 1);
+ const bool consider_components = (n_components(dof_handler) != 1);
// count how often we have added a value
// in the sum for each dof
std::vector<unsigned char> touch_count (dof_handler.n_dofs(), 0);
- typename DoFHandler<dim>::active_cell_iterator
- cell = dof_handler.begin_active(),
- endc = dof_handler.end();
- unsigned int present_cell = 0;
- const unsigned int dofs_per_cell = fe.dofs_per_cell;
- std::vector<unsigned int> dof_indices (dofs_per_cell);
+ typename DH<dim>::active_cell_iterator cell = dof_handler.begin_active(),
+ endc = dof_handler.end();
+ std::vector<unsigned int> dof_indices;
+ dof_indices.reserve (max_dofs_per_cell(dof_handler));
- for (; cell!=endc; ++cell, ++present_cell)
+ for (unsigned int present_cell = 0; cell!=endc; ++cell, ++present_cell)
{
+ const unsigned int dofs_per_cell = cell->get_fe().dofs_per_cell;
+ dof_indices.resize (dofs_per_cell);
cell->get_dof_indices (dof_indices);
+
for (unsigned int i=0; i<dofs_per_cell; ++i)
// consider this dof only if it
// is the right component. if there
// is only one component, short cut
// the test
if (!consider_components ||
- (fe.system_to_component_index(i).first == component))
+ (cell->get_fe().system_to_component_index(i).first == component))
{
// sum up contribution of the
// present_cell to this dof
}
-template<int dim>
+
+template <int dim>
void
-DoFTools::extract_dofs (const DoFHandler<dim> &dof,
- const std::vector<bool> &component_select,
- std::vector<bool> &selected_dofs)
+DoFTools::extract_dofs (const DoFHandler<dim> &dof,
+ const std::vector<bool> &component_select,
+ std::vector<bool> &selected_dofs)
{
- const FiniteElement<dim> &fe = dof.get_fe();
- Assert(component_select.size() == fe.n_components(),
- ExcDimensionMismatch(component_select.size(), fe.n_components()));
+ Assert(component_select.size() == n_components(dof),
+ ExcDimensionMismatch(component_select.size(), n_components(dof)));
Assert(selected_dofs.size() == dof.n_dofs(),
ExcDimensionMismatch(selected_dofs.size(), dof.n_dofs()));
// two special cases: no component
// is selected, and all components
- // are selected, both rather
+ // are selected; both rather
// stupid, but easy to catch
if (std::count (component_select.begin(), component_select.end(), true)
== 0)
return;
};
+
+ const FiniteElement<dim> &fe = dof.get_fe();
// preset all values by false
std::fill_n (selected_dofs.begin(), dof.n_dofs(), false);
#if deal_II_dimension != 1
-template <int dim>
+template <int dim, template <int> class DH>
void
-DoFTools::extract_boundary_dofs (const DoFHandler<dim> &dof_handler,
+DoFTools::extract_boundary_dofs (const DH<dim> &dof_handler,
const std::vector<bool> &component_select,
std::vector<bool> &selected_dofs,
const std::set<unsigned char> &boundary_indicators)
{
- const FiniteElement<dim> &fe = dof_handler.get_fe();
-
- Assert (component_select.size() == fe.n_components(),
+ Assert (component_select.size() == n_components(dof_handler),
ExcWrongSize (component_select.size(),
- fe.n_components()));
+ n_components(dof_handler)));
Assert (boundary_indicators.find (255) == boundary_indicators.end(),
ExcInvalidBoundaryIndicator());
// values
selected_dofs.clear ();
selected_dofs.resize (dof_handler.n_dofs(), false);
- std::vector<unsigned int> face_dof_indices (fe.dofs_per_face);
+ std::vector<unsigned int> face_dof_indices;
+ face_dof_indices.reserve (max_dofs_per_face(dof_handler));
// now loop over all cells and
// check whether their faces are at
(boundary_indicators.find (cell->face(face)->boundary_indicator())
!= boundary_indicators.end()))
{
+ const FiniteElement<dim> &fe = cell->get_fe();
+
+ const unsigned int dofs_per_face = fe.dofs_per_face;
+ face_dof_indices.resize (dofs_per_face);
cell->face(face)->get_dof_indices (face_dof_indices);
- for (unsigned int i=0; i<fe.dofs_per_face; ++i)
- if (!check_vector_component)
- selected_dofs[face_dof_indices[i]] = true;
+ for (unsigned int i=0; i<fe.dofs_per_face; ++i)
+ if (!check_vector_component)
+ selected_dofs[face_dof_indices[i]] = true;
else
// check for
// component is
fe.get_nonzero_components(cell_index).begin());
Assert (first_nonzero_comp < fe.n_components(),
ExcInternalError());
-
+
selected_dofs[face_dof_indices[i]]
= (component_select[first_nonzero_comp]
== true);
}
-#else
+#else // 1d
+template <template <int> class DH>
void
-DoFTools::extract_boundary_dofs (const DoFHandler<1> &dof_handler,
+DoFTools::extract_boundary_dofs (const DH<1> &dof_handler,
const std::vector<bool> &component_select,
std::vector<bool> &selected_dofs,
const std::set<unsigned char> &boundary_indicators)
{
- const FiniteElement<1> &fe = dof_handler.get_fe();
-
- Assert (component_select.size() == fe.n_components(),
+ Assert (component_select.size() == n_components(dof_handler),
ExcWrongSize (component_select.size(),
- fe.n_components()));
+ n_components(dof_handler)));
// clear and reset array by default
// values
selected_dofs.clear ();
selected_dofs.resize (dof_handler.n_dofs(), false);
- Assert (fe.dofs_per_face == fe.dofs_per_vertex,
- ExcInternalError());
-
// let's see whether we have to
// check for certain boundary
// indicators or whether we can
true));
// loop over coarse grid cells
- for (DoFHandler<1>::cell_iterator cell=dof_handler.begin(0);
+ for (typename DH<1>::cell_iterator cell=dof_handler.begin(0);
cell!=dof_handler.end(0); ++cell)
{
+ const FiniteElement<1> &fe = cell->get_fe();
+
// check left-most vertex
if (check_left_vertex)
if (cell->neighbor(0) == dof_handler.end())
- for (unsigned int i=0; i<fe.dofs_per_face; ++i)
- if (!check_vector_component)
- selected_dofs[cell->vertex_dof_index(0,i)] = true;
- else
- // check
- // component. make sure
- // we don't ask the
- // wrong question
- // (leading to an
- // exception) in case
- // the shape function
- // is non-primitive. note
- // that the face dof
- // index i is also the
- // cell dof index of a
- // corresponding dof in 1d
- {
- const unsigned int component =
- (fe.is_primitive(i) ?
- fe.face_system_to_component_index(i).first :
- (std::find (fe.get_nonzero_components(i).begin(),
- fe.get_nonzero_components(i).end(),
- true)
- -
- fe.get_nonzero_components(i).begin()));
- Assert (component < fe.n_components(),
- ExcInternalError());
-
- if (component_select[component] == true)
- selected_dofs[cell->vertex_dof_index(0,i)] = true;
- }
+ {
+ // In 1D the number of DoFs
+ // on the faces should be
+ // equal to the number of DoFs
+ // on the vertices.
+ Assert (fe.dofs_per_face ==
+ fe.dofs_per_vertex,
+ ExcInternalError());
+
+ for (unsigned int i=0; i<fe.dofs_per_face; ++i)
+ if (!check_vector_component)
+ selected_dofs[cell->vertex_dof_index(0,i)] = true;
+ else
+ // check
+ // component. make sure
+ // we don't ask the
+ // wrong question
+ // (leading to an
+ // exception) in case
+ // the shape function
+ // is non-primitive. note
+ // that the face dof
+ // index i is also the
+ // cell dof index of a
+ // corresponding dof in 1d
+ {
+ const unsigned int component =
+ (fe.is_primitive(i) ?
+ fe.face_system_to_component_index(i).first :
+ (std::find (fe.get_nonzero_components(i).begin(),
+ fe.get_nonzero_components(i).end(),
+ true)
+ -
+ fe.get_nonzero_components(i).begin()));
+ Assert (component < fe.n_components(),
+ ExcInternalError());
+
+ if (component_select[component] == true)
+ selected_dofs[cell->vertex_dof_index(0,i)] = true;
+ }
+ }
- // check right-most
- // vertex. same procedure here
- // as above
+ // check right-most
+ // vertex. same procedure here
+ // as above
if (check_right_vertex)
if (cell->neighbor(1) == dof_handler.end())
- for (unsigned int i=0; i<fe.dofs_per_face; ++i)
- if (!check_vector_component)
- selected_dofs[cell->vertex_dof_index(1,i)] = true;
- else
- {
- const unsigned int component =
- (fe.is_primitive(i) ?
- fe.face_system_to_component_index(i).first :
- (std::find (fe.get_nonzero_components(i).begin(),
- fe.get_nonzero_components(i).end(),
- true)
- -
- fe.get_nonzero_components(i).begin()));
- Assert (component < fe.n_components(),
- ExcInternalError());
-
- if (component_select[component] == true)
- selected_dofs[cell->vertex_dof_index(1,i)] = true;
- }
- };
+ {
+ Assert (fe.dofs_per_face ==
+ fe.dofs_per_vertex,
+ ExcInternalError());
+
+ for (unsigned int i=0; i<fe.dofs_per_face; ++i)
+ if (!check_vector_component)
+ selected_dofs[cell->vertex_dof_index(1,i)] = true;
+ else
+ {
+ const unsigned int component =
+ (fe.is_primitive(i) ?
+ fe.face_system_to_component_index(i).first :
+ (std::find (fe.get_nonzero_components(i).begin(),
+ fe.get_nonzero_components(i).end(),
+ true)
+ -
+ fe.get_nonzero_components(i).begin()));
+ Assert (component < fe.n_components(),
+ ExcInternalError());
+
+ if (component_select[component] == true)
+ selected_dofs[cell->vertex_dof_index(1,i)] = true;
+ }
+ }
+ }
}
-template <int dim>
+template <int dim, template <int> class DH>
void
-DoFTools::extract_subdomain_dofs (const DoFHandler<dim> &dof_handler,
- const unsigned int subdomain_id,
- std::vector<bool> &selected_dofs)
+DoFTools::extract_subdomain_dofs (const DH<dim> &dof_handler,
+ const unsigned int subdomain_id,
+ std::vector<bool> &selected_dofs)
{
Assert(selected_dofs.size() == dof_handler.n_dofs(),
ExcDimensionMismatch(selected_dofs.size(), dof_handler.n_dofs()));
// preset all values by false
std::fill_n (selected_dofs.begin(), dof_handler.n_dofs(), false);
- const unsigned int dofs_per_cell = dof_handler.get_fe().dofs_per_cell;
- std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+ std::vector<unsigned int> local_dof_indices;
+ local_dof_indices.reserve (max_dofs_per_cell(dof_handler));
- typename DoFHandler<dim>::active_cell_iterator
+ // this function is similar to the
+ // make_sparsity_pattern function,
+ // see there for more information
+ typename DH<dim>::active_cell_iterator
cell = dof_handler.begin_active(),
endc = dof_handler.end();
for (; cell!=endc; ++cell)
if (cell->subdomain_id() == subdomain_id)
{
+ const unsigned int dofs_per_cell = cell->get_fe().dofs_per_cell;
+ local_dof_indices.resize (dofs_per_cell);
cell->get_dof_indices (local_dof_indices);
for (unsigned int i=0; i<dofs_per_cell; ++i)
selected_dofs[local_dof_indices[i]] = true;
Threads::ThreadGroup<> threads;
for (unsigned int i=0; i<n_components; ++i)
{
- void (*fun_ptr) (const DoFHandler<dim> &,
- const std::vector<bool> &,
- std::vector<bool> &)
+ void (*fun_ptr) (const DoFHandler<dim> &,
+ const std::vector<bool> &,
+ std::vector<bool> &)
= &DoFTools::template extract_dofs<dim>;
component_select[i][i] = true;
threads += Threads::spawn (fun_ptr)(dof_handler, component_select[i],
dofs_per_component.end(), 0U)
== dof_handler.n_dofs()),
ExcInternalError());
-
}
-
template <int dim>
void
DoFTools::count_dofs_per_component (
// weights, have only one
// mutex for all of them
static Threads::ThreadMutex mutex;
- mutex.acquire ();
+ Threads::ThreadMutex::ScopedLock lock (mutex);
for (unsigned int i=0; i<global_parameter_representation.size(); ++i)
// set this weight if it belongs
// to a parameter dof.
else
Assert (global_parameter_representation(i) == 0,
ExcInternalError());
-
- mutex.release ();
};
};
}
#if deal_II_dimension == 1
+template <template <int> class DH>
void DoFTools::map_dof_to_boundary_indices (
- const DoFHandler<1> &dof_handler,
+ const DH<1> &dof_handler,
const std::set<unsigned char> &boundary_indicators,
std::vector<unsigned int> &mapping)
{
mapping.clear ();
mapping.insert (mapping.end(), dof_handler.n_dofs(),
- DoFHandler<1>::invalid_dof_index);
+ DH<1>::invalid_dof_index);
unsigned int next_free_index = 0;
// find active cell at that
// boundary: first go to
// left/right, then to children
- DoFHandler<1>::cell_iterator cell = dof_handler.begin(0);
+ typename DH<1>::cell_iterator cell = dof_handler.begin(0);
while (!cell->at_boundary(direction))
cell = cell->neighbor(direction);
while (!cell->active())
// next enumerate these degrees
// of freedom
- for (unsigned int i=0; i<dof_handler.get_fe().dofs_per_vertex; ++i)
+ for (unsigned int i=0; i<cell->get_fe().dofs_per_vertex; ++i)
mapping[cell->vertex_dof_index(direction,i)] = next_free_index++;
};
}
-void DoFTools::map_dof_to_boundary_indices (const DoFHandler<1> &dof_handler,
- std::vector<unsigned int> &mapping)
+void
+DoFTools::map_dof_to_boundary_indices (const DoFHandler<1> &dof_handler,
+ std::vector<unsigned int> &mapping)
{
Assert (&dof_handler.get_fe() != 0, ExcNoFESelected());
std::set<unsigned char> boundary_indicators;
boundary_indicators.insert (0U);
boundary_indicators.insert (1U);
- map_dof_to_boundary_indices (dof_handler, boundary_indicators, mapping);
+
+ map_dof_to_boundary_indices<DoFHandler> (dof_handler, boundary_indicators, mapping);
}
#else
-template <int dim>
-void DoFTools::map_dof_to_boundary_indices (const DoFHandler<dim> &dof_handler,
- std::vector<unsigned int> &mapping)
+template <int dim, template <int> class DH>
+void
+DoFTools::map_dof_to_boundary_indices (const DH<dim> &dof_handler,
+ std::vector<unsigned int> &mapping)
{
Assert (&dof_handler.get_fe() != 0, ExcNoFESelected());
mapping.clear ();
mapping.insert (mapping.end(), dof_handler.n_dofs(),
- DoFHandler<dim>::invalid_dof_index);
+ DH<dim>::invalid_dof_index);
- const unsigned int dofs_per_face = dof_handler.get_fe().dofs_per_face;
- std::vector<unsigned int> dofs_on_face(dofs_per_face);
+ std::vector<unsigned int> dofs_on_face;
+ dofs_on_face.reserve (max_dofs_per_face(dof_handler));
unsigned int next_boundary_index = 0;
// now loop over all cells and
// line is also part of a boundary
// face which we will be visiting
// sooner or later
- typename DoFHandler<dim>::active_face_iterator face = dof_handler.begin_active_face(),
- endf = dof_handler.end_face();
+ typename DH<dim>::active_face_iterator face = dof_handler.begin_active_face(),
+ endf = dof_handler.end_face();
for (; face!=endf; ++face)
if (face->at_boundary())
{
+ const unsigned int dofs_per_face = face->get_fe().dofs_per_face;
+ dofs_on_face.resize (dofs_per_face);
face->get_dof_indices (dofs_on_face);
for (unsigned int i=0; i<dofs_per_face; ++i)
- if (mapping[dofs_on_face[i]] == DoFHandler<dim>::invalid_dof_index)
+ if (mapping[dofs_on_face[i]] == DH<dim>::invalid_dof_index)
mapping[dofs_on_face[i]] = next_boundary_index++;
};
-template <int dim>
+template <int dim, template <int> class DH>
void DoFTools::map_dof_to_boundary_indices (
- const DoFHandler<dim> &dof_handler,
+ const DH<dim> &dof_handler,
const std::set<unsigned char> &boundary_indicators,
std::vector<unsigned int> &mapping)
{
mapping.clear ();
mapping.insert (mapping.end(), dof_handler.n_dofs(),
- DoFHandler<dim>::invalid_dof_index);
+ DH<dim>::invalid_dof_index);
// return if there is nothing to do
if (boundary_indicators.size() == 0)
return;
- const unsigned int dofs_per_face = dof_handler.get_fe().dofs_per_face;
- std::vector<unsigned int> dofs_on_face(dofs_per_face);
+ std::vector<unsigned int> dofs_on_face;
+ dofs_on_face.reserve (max_dofs_per_face(dof_handler));
unsigned int next_boundary_index = 0;
- typename DoFHandler<dim>::active_face_iterator face = dof_handler.begin_active_face(),
- endf = dof_handler.end_face();
+ typename DH<dim>::active_face_iterator face = dof_handler.begin_active_face(),
+ endf = dof_handler.end_face();
for (; face!=endf; ++face)
if (boundary_indicators.find (face->boundary_indicator()) !=
boundary_indicators.end())
{
+ const unsigned int dofs_per_face = face->get_fe().dofs_per_face;
+ dofs_on_face.resize (dofs_per_face);
face->get_dof_indices (dofs_on_face);
for (unsigned int i=0; i<dofs_per_face; ++i)
- if (mapping[dofs_on_face[i]] == DoFHandler<dim>::invalid_dof_index)
+ if (mapping[dofs_on_face[i]] == DH<dim>::invalid_dof_index)
mapping[dofs_on_face[i]] = next_boundary_index++;
};
- Assert (next_boundary_index == dof_handler.n_boundary_dofs(boundary_indicators),
+ Assert (next_boundary_index == dof_handler.n_boundary_dofs (boundary_indicators),
ExcInternalError());
}
const Table<2,Coupling>& couplings, const Table<2,Coupling>& flux_couplings);
template void
-DoFTools::make_sparsity_pattern<deal_II_dimension,SparsityPattern>
+DoFTools::make_sparsity_pattern<deal_II_dimension,SparsityPattern,DoFHandler>
(const DoFHandler<deal_II_dimension> &dof,
SparsityPattern &sparsity);
+template void
+DoFTools::make_sparsity_pattern<deal_II_dimension,SparsityPattern,hpDoFHandler>
+(const hpDoFHandler<deal_II_dimension> &dof,
+ SparsityPattern &sparsity);
template void
-DoFTools::make_sparsity_pattern<deal_II_dimension,CompressedSparsityPattern>
+DoFTools::make_sparsity_pattern<deal_II_dimension,CompressedSparsityPattern,DoFHandler>
(const DoFHandler<deal_II_dimension> &dof,
CompressedSparsityPattern &sparsity);
+template void
+DoFTools::make_sparsity_pattern<deal_II_dimension,CompressedSparsityPattern,hpDoFHandler>
+(const hpDoFHandler<deal_II_dimension> &dof,
+ CompressedSparsityPattern &sparsity);
template void
-DoFTools::make_sparsity_pattern<deal_II_dimension,BlockSparsityPattern>
+DoFTools::make_sparsity_pattern<deal_II_dimension,BlockSparsityPattern,DoFHandler>
(const DoFHandler<deal_II_dimension> &dof,
BlockSparsityPattern &sparsity);
template void
-DoFTools::make_sparsity_pattern<deal_II_dimension,CompressedBlockSparsityPattern>
+DoFTools::make_sparsity_pattern<deal_II_dimension,BlockSparsityPattern,hpDoFHandler>
+(const hpDoFHandler<deal_II_dimension> &dof,
+ BlockSparsityPattern &sparsity);
+
+template void
+DoFTools::make_sparsity_pattern<deal_II_dimension,CompressedBlockSparsityPattern,DoFHandler>
(const DoFHandler<deal_II_dimension> &dof,
CompressedBlockSparsityPattern &sparsity);
+template void
+DoFTools::make_sparsity_pattern<deal_II_dimension,CompressedBlockSparsityPattern,hpDoFHandler>
+(const hpDoFHandler<deal_II_dimension> &dof,
+ CompressedBlockSparsityPattern &sparsity);
template void
const std::vector<unsigned int> &,
SparsityPattern &);
template void
+DoFTools::make_boundary_sparsity_pattern<deal_II_dimension,SparsityPattern>
+(const hpDoFHandler<deal_II_dimension>& dof,
+ const std::vector<unsigned int> &,
+ SparsityPattern &);
+template void
DoFTools::make_boundary_sparsity_pattern<deal_II_dimension,CompressedSparsityPattern>
(const DoFHandler<deal_II_dimension>& dof,
const std::vector<unsigned int> &,
CompressedSparsityPattern &);
template void
+DoFTools::make_boundary_sparsity_pattern<deal_II_dimension,CompressedSparsityPattern>
+(const hpDoFHandler<deal_II_dimension>& dof,
+ const std::vector<unsigned int> &,
+ CompressedSparsityPattern &);
+template void
DoFTools::make_boundary_sparsity_pattern<deal_II_dimension,BlockSparsityPattern>
(const DoFHandler<deal_II_dimension>& dof,
const std::vector<unsigned int> &,
BlockSparsityPattern &);
template void
+DoFTools::make_boundary_sparsity_pattern<deal_II_dimension,BlockSparsityPattern>
+(const hpDoFHandler<deal_II_dimension>& dof,
+ const std::vector<unsigned int> &,
+ BlockSparsityPattern &);
+template void
DoFTools::make_boundary_sparsity_pattern<deal_II_dimension,CompressedBlockSparsityPattern>
(const DoFHandler<deal_II_dimension>& dof,
const std::vector<unsigned int> &,
CompressedBlockSparsityPattern &);
+template void
+DoFTools::make_boundary_sparsity_pattern<deal_II_dimension,CompressedBlockSparsityPattern>
+(const hpDoFHandler<deal_II_dimension>& dof,
+ const std::vector<unsigned int> &,
+ CompressedBlockSparsityPattern &);
template void
DoFTools::make_boundary_sparsity_pattern<deal_II_dimension,SparsityPattern>
const std::vector<unsigned int> &dof_to_boundary_mapping,
SparsityPattern &sparsity);
template void
+DoFTools::make_boundary_sparsity_pattern<deal_II_dimension,SparsityPattern>
+(const hpDoFHandler<deal_II_dimension>& dof,
+ const FunctionMap<deal_II_dimension>::type &boundary_indicators,
+ const std::vector<unsigned int> &dof_to_boundary_mapping,
+ SparsityPattern &sparsity);
+template void
DoFTools::make_boundary_sparsity_pattern<deal_II_dimension,CompressedSparsityPattern>
(const DoFHandler<deal_II_dimension>& dof,
const FunctionMap<deal_II_dimension>::type &boundary_indicators,
const std::vector<unsigned int> &dof_to_boundary_mapping,
CompressedSparsityPattern &sparsity);
template void
+DoFTools::make_boundary_sparsity_pattern<deal_II_dimension,CompressedSparsityPattern>
+(const hpDoFHandler<deal_II_dimension>& dof,
+ const FunctionMap<deal_II_dimension>::type &boundary_indicators,
+ const std::vector<unsigned int> &dof_to_boundary_mapping,
+ CompressedSparsityPattern &sparsity);
+template void
DoFTools::make_boundary_sparsity_pattern<deal_II_dimension,BlockSparsityPattern>
(const DoFHandler<deal_II_dimension>& dof,
const FunctionMap<deal_II_dimension>::type &boundary_indicators,
const std::vector<unsigned int> &dof_to_boundary_mapping,
BlockSparsityPattern &sparsity);
template void
+DoFTools::make_boundary_sparsity_pattern<deal_II_dimension,BlockSparsityPattern>
+(const hpDoFHandler<deal_II_dimension>& dof,
+ const FunctionMap<deal_II_dimension>::type &boundary_indicators,
+ const std::vector<unsigned int> &dof_to_boundary_mapping,
+ BlockSparsityPattern &sparsity);
+template void
DoFTools::make_boundary_sparsity_pattern<deal_II_dimension,CompressedBlockSparsityPattern>
(const DoFHandler<deal_II_dimension>& dof,
const FunctionMap<deal_II_dimension>::type &boundary_indicators,
const std::vector<unsigned int> &dof_to_boundary_mapping,
CompressedBlockSparsityPattern &sparsity);
+template void
+DoFTools::make_boundary_sparsity_pattern<deal_II_dimension,CompressedBlockSparsityPattern>
+(const hpDoFHandler<deal_II_dimension>& dof,
+ const FunctionMap<deal_II_dimension>::type &boundary_indicators,
+ const std::vector<unsigned int> &dof_to_boundary_mapping,
+ CompressedBlockSparsityPattern &sparsity);
#endif
#if deal_II_dimension == 1
const std::vector<unsigned int> &,
SparsityPattern &);
template void
+DoFTools::make_boundary_sparsity_pattern<SparsityPattern>
+(const hpDoFHandler<deal_II_dimension>& dof,
+ const std::vector<unsigned int> &,
+ SparsityPattern &);
+template void
DoFTools::make_boundary_sparsity_pattern<CompressedSparsityPattern>
(const DoFHandler<deal_II_dimension>& dof,
const std::vector<unsigned int> &,
CompressedSparsityPattern &);
template void
+DoFTools::make_boundary_sparsity_pattern<CompressedSparsityPattern>
+(const hpDoFHandler<deal_II_dimension>& dof,
+ const std::vector<unsigned int> &,
+ CompressedSparsityPattern &);
+template void
DoFTools::make_boundary_sparsity_pattern<BlockSparsityPattern>
(const DoFHandler<deal_II_dimension>& dof,
const std::vector<unsigned int> &,
BlockSparsityPattern &);
template void
+DoFTools::make_boundary_sparsity_pattern<BlockSparsityPattern>
+(const hpDoFHandler<deal_II_dimension>& dof,
+ const std::vector<unsigned int> &,
+ BlockSparsityPattern &);
+template void
DoFTools::make_boundary_sparsity_pattern<CompressedBlockSparsityPattern>
(const DoFHandler<deal_II_dimension>& dof,
const std::vector<unsigned int> &,
CompressedBlockSparsityPattern &);
+template void
+DoFTools::make_boundary_sparsity_pattern<CompressedBlockSparsityPattern>
+(const hpDoFHandler<deal_II_dimension>& dof,
+ const std::vector<unsigned int> &,
+ CompressedBlockSparsityPattern &);
template void
DoFTools::make_boundary_sparsity_pattern<SparsityPattern>
const std::vector<unsigned int> &dof_to_boundary_mapping,
SparsityPattern &sparsity);
template void
+DoFTools::make_boundary_sparsity_pattern<SparsityPattern>
+(const hpDoFHandler<deal_II_dimension>& dof,
+ const FunctionMap<deal_II_dimension>::type &boundary_indicators,
+ const std::vector<unsigned int> &dof_to_boundary_mapping,
+ SparsityPattern &sparsity);
+template void
DoFTools::make_boundary_sparsity_pattern<CompressedSparsityPattern>
(const DoFHandler<deal_II_dimension>& dof,
const FunctionMap<deal_II_dimension>::type &boundary_indicators,
const std::vector<unsigned int> &dof_to_boundary_mapping,
CompressedSparsityPattern &sparsity);
template void
+DoFTools::make_boundary_sparsity_pattern<CompressedSparsityPattern>
+(const hpDoFHandler<deal_II_dimension>& dof,
+ const FunctionMap<deal_II_dimension>::type &boundary_indicators,
+ const std::vector<unsigned int> &dof_to_boundary_mapping,
+ CompressedSparsityPattern &sparsity);
+template void
DoFTools::make_boundary_sparsity_pattern<BlockSparsityPattern>
(const DoFHandler<deal_II_dimension>& dof,
const FunctionMap<deal_II_dimension>::type &boundary_indicators,
const std::vector<unsigned int> &dof_to_boundary_mapping,
BlockSparsityPattern &sparsity);
template void
+DoFTools::make_boundary_sparsity_pattern<BlockSparsityPattern>
+(const hpDoFHandler<deal_II_dimension>& dof,
+ const FunctionMap<deal_II_dimension>::type &boundary_indicators,
+ const std::vector<unsigned int> &dof_to_boundary_mapping,
+ BlockSparsityPattern &sparsity);
+template void
DoFTools::make_boundary_sparsity_pattern<CompressedBlockSparsityPattern>
(const DoFHandler<deal_II_dimension>& dof,
const FunctionMap<deal_II_dimension>::type &boundary_indicators,
const std::vector<unsigned int> &dof_to_boundary_mapping,
CompressedBlockSparsityPattern &sparsity);
+template void
+DoFTools::make_boundary_sparsity_pattern<CompressedBlockSparsityPattern>
+(const hpDoFHandler<deal_II_dimension>& dof,
+ const FunctionMap<deal_II_dimension>::type &boundary_indicators,
+ const std::vector<unsigned int> &dof_to_boundary_mapping,
+ CompressedBlockSparsityPattern &sparsity);
#endif
(const DoFHandler<deal_II_dimension>& dof,
SparsityPattern &sparsity);
template void
+DoFTools::make_flux_sparsity_pattern<deal_II_dimension,SparsityPattern>
+(const hpDoFHandler<deal_II_dimension>& dof,
+ SparsityPattern &sparsity);
+template void
DoFTools::make_flux_sparsity_pattern<deal_II_dimension,CompressedSparsityPattern>
(const DoFHandler<deal_II_dimension>& dof,
CompressedSparsityPattern &sparsity);
template void
+DoFTools::make_flux_sparsity_pattern<deal_II_dimension,CompressedSparsityPattern>
+(const hpDoFHandler<deal_II_dimension>& dof,
+ CompressedSparsityPattern &sparsity);
+template void
DoFTools::make_flux_sparsity_pattern<deal_II_dimension,BlockSparsityPattern>
(const DoFHandler<deal_II_dimension>& dof,
BlockSparsityPattern &sparsity);
template void
+DoFTools::make_flux_sparsity_pattern<deal_II_dimension,BlockSparsityPattern>
+(const hpDoFHandler<deal_II_dimension>& dof,
+ BlockSparsityPattern &sparsity);
+template void
DoFTools::make_flux_sparsity_pattern<deal_II_dimension,CompressedBlockSparsityPattern>
(const DoFHandler<deal_II_dimension>& dof,
CompressedBlockSparsityPattern &sparsity);
+template void
+DoFTools::make_flux_sparsity_pattern<deal_II_dimension,CompressedBlockSparsityPattern>
+(const hpDoFHandler<deal_II_dimension>& dof,
+ CompressedBlockSparsityPattern &sparsity);
#else
template void
DoFTools::make_flux_sparsity_pattern<SparsityPattern>
(const DoFHandler<1>& dof,
SparsityPattern &sparsity);
template void
+DoFTools::make_flux_sparsity_pattern<SparsityPattern>
+(const hpDoFHandler<1>& dof,
+ SparsityPattern &sparsity);
+template void
DoFTools::make_flux_sparsity_pattern<CompressedSparsityPattern>
(const DoFHandler<1>& dof,
CompressedSparsityPattern &sparsity);
template void
+DoFTools::make_flux_sparsity_pattern<CompressedSparsityPattern>
+(const hpDoFHandler<1>& dof,
+ CompressedSparsityPattern &sparsity);
+template void
DoFTools::make_flux_sparsity_pattern<BlockSparsityPattern>
(const DoFHandler<1>& dof,
BlockSparsityPattern &sparsity);
template void
+DoFTools::make_flux_sparsity_pattern<BlockSparsityPattern>
+(const hpDoFHandler<1>& dof,
+ BlockSparsityPattern &sparsity);
+template void
DoFTools::make_flux_sparsity_pattern<CompressedBlockSparsityPattern>
(const DoFHandler<1>& dof,
CompressedBlockSparsityPattern &sparsity);
+template void
+DoFTools::make_flux_sparsity_pattern<CompressedBlockSparsityPattern>
+(const hpDoFHandler<1>& dof,
+ CompressedBlockSparsityPattern &sparsity);
#endif
#if deal_II_dimension > 1
#if deal_II_dimension != 1
template
void
-DoFTools::extract_boundary_dofs<deal_II_dimension>
+DoFTools::extract_boundary_dofs<deal_II_dimension,DoFHandler>
(const DoFHandler<deal_II_dimension> &,
const std::vector<bool> &,
std::vector<bool> &,
const std::set<unsigned char> &);
+
+#else
+
+template
+void
+DoFTools::extract_boundary_dofs<DoFHandler>
+(const DoFHandler<1> &,
+ const std::vector<bool> &,
+ std::vector<bool> &,
+ const std::set<unsigned char> &);
#endif
template
void
-DoFTools::extract_subdomain_dofs<deal_II_dimension>
+DoFTools::extract_subdomain_dofs<deal_II_dimension, DoFHandler>
(const DoFHandler<deal_II_dimension> &dof_handler,
const unsigned int subdomain_id,
std::vector<bool> &selected_dofs);
+template
+void
+DoFTools::extract_subdomain_dofs<deal_II_dimension, hpDoFHandler>
+(const hpDoFHandler<deal_II_dimension> &dof_handler,
+ const unsigned int subdomain_id,
+ std::vector<bool> &selected_dofs);
+
template
void
DoFTools::get_subdomain_association<deal_II_dimension>
std::vector<std::map<unsigned int, float> > &);
+#if deal_II_dimension == 1
-#if deal_II_dimension != 1
+template
+void
+DoFTools::map_dof_to_boundary_indices<DoFHandler>
+(const DoFHandler<deal_II_dimension> &,
+ const std::set<unsigned char> &,
+ std::vector<unsigned int> &);
+
+#else
template
void
const std::set<unsigned char> &,
std::vector<unsigned int> &);
-#endif
-
+#endif
template
--- /dev/null
+//---------------------------- hp_dof_accessor.cc ------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2003 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- hp_dof_accessor.cc ------------------------
+
+
+#include <lac/vector.h>
+#include <lac/block_vector.h>
+#include <lac/sparse_matrix.h>
+
+#include <dofs/dof_accessor.h>
+#include <dofs/dof_accessor.templates.h>
+#include <dofs/dof_levels.h>
+#include <dofs/hp_dof_handler.h>
+#include <dofs/hp_dof_levels.h>
+#include <grid/tria_iterator.h>
+#include <grid/tria_iterator.templates.h>
+#include <fe/fe.h>
+
+#include <vector>
+
+
+/*------------------------- Functions: DoFCellAccessor -----------------------*/
+
+#if deal_II_dimension == 1
+
+template <>
+TriaIterator<1, DoFObjectAccessor<0,1,hpDoFHandler> >
+DoFCellAccessor<1,hpDoFHandler>::face (const unsigned int) const
+{
+ Assert (false, ExcImpossibleInDim(1));
+ return TriaIterator<1, DoFObjectAccessor<0,1, hpDoFHandler> >();
+}
+
+#endif
+
+
+#if deal_II_dimension == 2
+
+template <>
+TriaIterator<2, DoFObjectAccessor<1,2,hpDoFHandler> >
+DoFCellAccessor<2,hpDoFHandler>::face (const unsigned int i) const
+{
+ return this->line(i);
+}
+
+#endif
+
+
+#if deal_II_dimension == 3
+
+template <>
+TriaIterator<3, DoFObjectAccessor<2, 3, hpDoFHandler> >
+DoFCellAccessor<3,hpDoFHandler>::face (const unsigned int i) const
+{
+ return this->quad(i);
+}
+
+#endif
+
+
+/*----------------- Functions: DoFObjectAccessor<1,dim,hpDoFHander> ----------*/
+
+template <>
+void DoFObjectAccessor<1, 1, hpDoFHandler>::set_dof_index (const unsigned int i,
+ const unsigned int index) const
+{
+ typedef DoFAccessor<1, hpDoFHandler> BaseClass;
+
+ Assert (this->dof_handler != 0,
+ BaseClass::ExcInvalidObject());
+ // make sure a FE has been selected
+ // and enough room was reserved
+ Assert (&this->get_fe() != 0,
+ BaseClass::ExcInvalidObject());
+ Assert (i<this->get_fe().dofs_per_line,
+ ExcIndexRange (i, 0, this->get_fe().dofs_per_line));
+
+ unsigned int offset = this->dof_handler->levels[this->present_level]
+ ->dof_line_index_offset[this->present_index];
+ this->dof_handler->levels[this->present_level]
+ ->line_dofs[offset+i] = index;
+}
+
+
+template <>
+void DoFObjectAccessor<1, 2, hpDoFHandler>::set_dof_index (const unsigned int i,
+ const unsigned int index) const
+{
+ typedef DoFAccessor<2, hpDoFHandler> BaseClass;
+
+ Assert (this->dof_handler != 0,
+ BaseClass::ExcInvalidObject());
+ // make sure a FE has been selected
+ // and enough room was reserved
+ Assert (&this->get_fe() != 0,
+ BaseClass::ExcInvalidObject());
+ Assert (i<this->get_fe().dofs_per_line,
+ ExcIndexRange (i, 0, this->get_fe().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.
+
+ unsigned int offset = this->dof_handler->levels[this->present_level]
+ ->dof_line_index_offset[this->present_index];
+ this->dof_handler->levels[this->present_level]
+ ->line_dofs[offset+i] = index;
+}
+
+
+template <>
+void DoFObjectAccessor<1, 3, hpDoFHandler>::set_dof_index (const unsigned int i,
+ const unsigned int index) const
+{
+ typedef DoFAccessor<3, hpDoFHandler> BaseClass;
+
+ Assert (this->dof_handler != 0,
+ BaseClass::ExcInvalidObject());
+ // make sure a FE has been selected
+ // and enough room was reserved
+ Assert (&this->get_fe() != 0,
+ BaseClass::ExcInvalidObject());
+ Assert (i<this->get_fe().dofs_per_line,
+ ExcIndexRange (i, 0, this->get_fe().dofs_per_line));
+
+ unsigned int offset = this->dof_handler->levels[this->present_level]
+ ->dof_line_index_offset[this->present_index];
+ this->dof_handler->levels[this->present_level]
+ ->line_dofs[offset+i] = index;
+}
+
+
+
+/*----------------- Functions: DoFObjectAccessor<2,dim,hpDoFHander> ----------*/
+
+template <>
+void DoFObjectAccessor<2, 2, hpDoFHandler>::set_dof_index (const unsigned int i,
+ const unsigned int index) const
+{
+ typedef DoFAccessor<2, hpDoFHandler> BaseClass;
+
+ Assert (this->dof_handler != 0,
+ BaseClass::ExcInvalidObject());
+ // make sure a FE has been selected
+ // and enough room was reserved
+ Assert (&this->get_fe() != 0,
+ BaseClass::ExcInvalidObject());
+ Assert (i<this->get_fe().dofs_per_quad,
+ ExcIndexRange (i, 0, this->get_fe().dofs_per_quad));
+
+ unsigned int offset = this->dof_handler->levels[this->present_level]
+ ->dof_quad_index_offset[this->present_index];
+ this->dof_handler->levels[this->present_level]
+ ->quad_dofs[offset+i] = index;
+}
+
+
+template <>
+void DoFObjectAccessor<2, 3, hpDoFHandler>::set_dof_index (const unsigned int i,
+ const unsigned int index) const
+{
+ typedef DoFAccessor<3, hpDoFHandler> BaseClass;
+
+ Assert (this->dof_handler != 0,
+ BaseClass::ExcInvalidObject());
+ // make sure a FE has been selected
+ // and enough room was reserved
+ Assert (&this->get_fe() != 0,
+ BaseClass::ExcInvalidObject());
+ Assert (i<this->get_fe().dofs_per_quad,
+ ExcIndexRange (i, 0, this->get_fe().dofs_per_quad));
+
+ unsigned int offset = this->dof_handler->levels[this->present_level]
+ ->dof_quad_index_offset[this->present_index];
+ this->dof_handler->levels[this->present_level]
+ ->quad_dofs[offset+i] = index;
+}
+
+
+/*----------------- Functions: DoFObjectAccessor<3,dim,hpDoFHander> ----------*/
+
+template <>
+void DoFObjectAccessor<3, 3, hpDoFHandler>::set_dof_index (const unsigned int i,
+ const unsigned int index) const
+{
+ typedef DoFAccessor<3, hpDoFHandler> BaseClass;
+
+ Assert (this->dof_handler != 0,
+ BaseClass::ExcInvalidObject());
+ // make sure a FE has been selected
+ // and enough room was reserved
+ Assert (&this->get_fe() != 0,
+ BaseClass::ExcInvalidObject());
+ Assert (i<this->get_fe().dofs_per_hex,
+ ExcIndexRange (i, 0, this->get_fe().dofs_per_hex));
+
+ unsigned int offset = this->dof_handler->levels[this->present_level]
+ ->dof_hex_index_offset[this->present_index];
+ this->dof_handler->levels[this->present_level]
+ ->hex_dofs[offset+i] = index;
+}
--- /dev/null
+//---------------------------- hp_dof_handler.cc ------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2003, 2004 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- hp_dof_handler.cc ------------------------
+
+
+#include <base/memory_consumption.h>
+#include <dofs/hp_dof_handler.h>
+#include <dofs/hp_dof_levels.h>
+#include <dofs/dof_accessor.h>
+#include <grid/tria_accessor.h>
+#include <grid/tria_iterator.h>
+#include <grid/tria_levels.h>
+#include <grid/tria.h>
+#include <grid/geometry_info.h>
+#include <fe/fe.h>
+
+#include <set>
+#include <algorithm>
+#include <functional>
+
+
+
+template <int dim>
+const unsigned int hpDoFHandler<dim>::invalid_dof_index;
+
+
+
+template <int dim>
+hpDoFHandler<dim>::hpDoFHandler (const Triangulation<dim> &tria)
+ :
+ tria(&tria),
+ used_dofs (0)
+{
+ tria.add_refinement_listener (*this);
+}
+
+
+template <int dim>
+hpDoFHandler<dim>::~hpDoFHandler ()
+{
+ // unsubscribe as a listener to refinement
+ // of the underlying triangulation
+ tria->remove_refinement_listener (*this);
+
+ // ...and release allocated memory
+ clear ();
+}
+
+
+#if deal_II_dimension == 1
+
+template <>
+hpDoFHandler<1>::raw_cell_iterator
+hpDoFHandler<1>::begin_raw (const unsigned int level) const {
+ return begin_raw_line (level);
+}
+
+
+template <>
+hpDoFHandler<1>::cell_iterator
+hpDoFHandler<1>::begin (const unsigned int level) const {
+ return begin_line (level);
+}
+
+
+template <>
+hpDoFHandler<1>::active_cell_iterator
+hpDoFHandler<1>::begin_active (const unsigned int level) const {
+ return begin_active_line (level);
+}
+
+
+template <>
+hpDoFHandler<1>::raw_cell_iterator
+hpDoFHandler<1>::end () const {
+ return end_line ();
+}
+
+
+template <>
+hpDoFHandler<1>::raw_cell_iterator
+hpDoFHandler<1>::last_raw () const {
+ return last_raw_line ();
+}
+
+
+template <>
+hpDoFHandler<1>::raw_cell_iterator
+hpDoFHandler<1>::last_raw (const unsigned int level) const {
+ return last_raw_line (level);
+}
+
+
+template <>
+hpDoFHandler<1>::cell_iterator
+hpDoFHandler<1>::last () const {
+ return last_line ();
+}
+
+
+template <>
+hpDoFHandler<1>::cell_iterator
+hpDoFHandler<1>::last (const unsigned int level) const {
+ return last_line (level);
+}
+
+
+template <>
+hpDoFHandler<1>::active_cell_iterator
+hpDoFHandler<1>::last_active () const {
+ return last_active_line ();
+}
+
+
+template <>
+hpDoFHandler<1>::active_cell_iterator
+hpDoFHandler<1>::last_active (const unsigned int level) const {
+ return last_active_line (level);
+}
+
+
+template <>
+hpDoFHandler<1>::raw_face_iterator
+hpDoFHandler<1>::begin_raw_face (const unsigned int) const {
+ Assert (false, ExcFunctionNotUseful());
+ return 0;
+}
+
+
+template <>
+hpDoFHandler<1>::face_iterator
+hpDoFHandler<1>::begin_face (const unsigned int) const {
+ Assert (false, ExcFunctionNotUseful());
+ return 0;
+}
+
+
+template <>
+hpDoFHandler<1>::active_face_iterator
+hpDoFHandler<1>::begin_active_face (const unsigned int) const {
+ Assert (false, ExcFunctionNotUseful());
+ return 0;
+}
+
+
+template <>
+hpDoFHandler<1>::raw_face_iterator
+hpDoFHandler<1>::end_face () const {
+ Assert (false, ExcFunctionNotUseful());
+ return 0;
+}
+
+
+template <>
+hpDoFHandler<1>::raw_face_iterator
+hpDoFHandler<1>::last_raw_face () const {
+ Assert (false, ExcFunctionNotUseful());
+ return 0;
+}
+
+
+template <>
+hpDoFHandler<1>::raw_face_iterator
+hpDoFHandler<1>::last_raw_face (const unsigned int) const {
+ Assert (false, ExcFunctionNotUseful());
+ return 0;
+}
+
+
+template <>
+hpDoFHandler<1>::face_iterator
+hpDoFHandler<1>::last_face () const {
+ Assert (false, ExcFunctionNotUseful());
+ return 0;
+}
+
+
+template <>
+hpDoFHandler<1>::face_iterator
+hpDoFHandler<1>::last_face (const unsigned int) const {
+ Assert (false, ExcFunctionNotUseful());
+ return 0;
+}
+
+
+template <>
+hpDoFHandler<1>::active_face_iterator
+hpDoFHandler<1>::last_active_face () const {
+ Assert (false, ExcFunctionNotUseful());
+ return 0;
+}
+
+
+template <>
+hpDoFHandler<1>::active_face_iterator
+hpDoFHandler<1>::last_active_face (const unsigned int) const {
+ Assert (false, ExcFunctionNotUseful());
+ return 0;
+}
+
+
+template <>
+hpDoFHandler<1>::raw_quad_iterator
+hpDoFHandler<1>::begin_raw_quad (const unsigned int) const {
+ Assert (false, ExcNotImplemented());
+ return 0;
+}
+
+
+template <>
+hpDoFHandler<1>::quad_iterator
+hpDoFHandler<1>::begin_quad (const unsigned int) const {
+ Assert (false, ExcNotImplemented());
+ return 0;
+}
+
+
+template <>
+hpDoFHandler<1>::active_quad_iterator
+hpDoFHandler<1>::begin_active_quad (const unsigned int) const {
+ Assert (false, ExcNotImplemented());
+ return 0;
+}
+
+
+template <>
+hpDoFHandler<1>::raw_quad_iterator
+hpDoFHandler<1>::end_quad () const {
+ Assert (false, ExcNotImplemented());
+ return 0;
+}
+
+
+template <>
+hpDoFHandler<1>::raw_quad_iterator
+hpDoFHandler<1>::last_raw_quad (const unsigned int) const {
+ Assert (false, ExcNotImplemented());
+ return 0;
+}
+
+
+template <>
+hpDoFHandler<1>::quad_iterator
+hpDoFHandler<1>::last_quad (const unsigned int) const {
+ Assert (false, ExcNotImplemented());
+ return 0;
+}
+
+
+template <>
+hpDoFHandler<1>::active_quad_iterator
+hpDoFHandler<1>::last_active_quad (const unsigned int) const {
+ Assert (false, ExcNotImplemented());
+ return 0;
+}
+
+
+template <>
+hpDoFHandler<1>::raw_quad_iterator
+hpDoFHandler<1>::last_raw_quad () const {
+ Assert (false, ExcNotImplemented());
+ return 0;
+}
+
+
+template <>
+hpDoFHandler<1>::quad_iterator
+hpDoFHandler<1>::last_quad () const {
+ Assert (false, ExcNotImplemented());
+ return 0;
+}
+
+
+template <>
+hpDoFHandler<1>::active_quad_iterator
+hpDoFHandler<1>::last_active_quad () const {
+ Assert (false, ExcNotImplemented());
+ return 0;
+}
+
+
+template <>
+hpDoFHandler<1>::raw_hex_iterator
+hpDoFHandler<1>::begin_raw_hex (const unsigned int) const {
+ Assert (false, ExcNotImplemented());
+ return 0;
+}
+
+
+template <>
+hpDoFHandler<1>::hex_iterator
+hpDoFHandler<1>::begin_hex (const unsigned int) const {
+ Assert (false, ExcNotImplemented());
+ return 0;
+}
+
+
+template <>
+hpDoFHandler<1>::active_hex_iterator
+hpDoFHandler<1>::begin_active_hex (const unsigned int) const {
+ Assert (false, ExcNotImplemented());
+ return 0;
+}
+
+
+template <>
+hpDoFHandler<1>::raw_hex_iterator
+hpDoFHandler<1>::end_hex () const {
+ Assert (false, ExcNotImplemented());
+ return 0;
+}
+
+
+template <>
+hpDoFHandler<1>::raw_hex_iterator
+hpDoFHandler<1>::last_raw_hex (const unsigned int) const {
+ Assert (false, ExcNotImplemented());
+ return 0;
+}
+
+
+template <>
+hpDoFHandler<1>::raw_hex_iterator
+hpDoFHandler<1>::last_raw_hex () const {
+ Assert (false, ExcNotImplemented());
+ return 0;
+}
+
+
+template <>
+hpDoFHandler<1>::hex_iterator
+hpDoFHandler<1>::last_hex (const unsigned int) const {
+ Assert (false, ExcNotImplemented());
+ return 0;
+}
+
+
+template <>
+hpDoFHandler<1>::hex_iterator
+hpDoFHandler<1>::last_hex () const {
+ Assert (false, ExcNotImplemented());
+ return 0;
+}
+
+
+template <>
+hpDoFHandler<1>::active_hex_iterator
+hpDoFHandler<1>::last_active_hex (const unsigned int) const {
+ Assert (false, ExcNotImplemented());
+ return 0;
+}
+
+
+template <>
+hpDoFHandler<1>::active_hex_iterator
+hpDoFHandler<1>::last_active_hex () const {
+ Assert (false, ExcNotImplemented());
+ return 0;
+}
+
+#endif
+
+
+#if deal_II_dimension == 2
+
+template <>
+hpDoFHandler<2>::raw_cell_iterator
+hpDoFHandler<2>::begin_raw (const unsigned int level) const {
+ return begin_raw_quad (level);
+}
+
+
+template <>
+hpDoFHandler<2>::cell_iterator
+hpDoFHandler<2>::begin (const unsigned int level) const {
+ return begin_quad (level);
+}
+
+
+template <>
+hpDoFHandler<2>::active_cell_iterator
+hpDoFHandler<2>::begin_active (const unsigned int level) const {
+ return begin_active_quad (level);
+}
+
+
+template <>
+hpDoFHandler<2>::raw_cell_iterator
+hpDoFHandler<2>::end () const {
+ return end_quad ();
+}
+
+
+template <>
+hpDoFHandler<2>::raw_cell_iterator
+hpDoFHandler<2>::last_raw () const {
+ return last_raw_quad ();
+}
+
+
+template <>
+hpDoFHandler<2>::raw_cell_iterator
+hpDoFHandler<2>::last_raw (const unsigned int level) const {
+ return last_raw_quad (level);
+}
+
+
+template <>
+hpDoFHandler<2>::cell_iterator
+hpDoFHandler<2>::last () const {
+ return last_quad ();
+}
+
+
+template <>
+hpDoFHandler<2>::cell_iterator
+hpDoFHandler<2>::last (const unsigned int level) const {
+ return last_quad (level);
+}
+
+
+template <>
+hpDoFHandler<2>::active_cell_iterator
+hpDoFHandler<2>::last_active () const {
+ return last_active_quad ();
+}
+
+
+template <>
+hpDoFHandler<2>::active_cell_iterator
+hpDoFHandler<2>::last_active (const unsigned int level) const {
+ return last_active_quad (level);
+}
+
+
+template <>
+hpDoFHandler<2>::raw_face_iterator
+hpDoFHandler<2>::begin_raw_face (const unsigned int level) const {
+ return begin_raw_line (level);
+}
+
+
+template <>
+hpDoFHandler<2>::face_iterator
+hpDoFHandler<2>::begin_face (const unsigned int level) const {
+ return begin_line (level);
+}
+
+
+template <>
+hpDoFHandler<2>::active_face_iterator
+hpDoFHandler<2>::begin_active_face (const unsigned int level) const {
+ return begin_active_line (level);
+}
+
+
+template <>
+hpDoFHandler<2>::raw_face_iterator
+hpDoFHandler<2>::end_face () const {
+ return end_line ();
+}
+
+
+template <>
+hpDoFHandler<2>::raw_face_iterator
+hpDoFHandler<2>::last_raw_face () const {
+ return last_raw_line ();
+}
+
+
+template <>
+hpDoFHandler<2>::raw_face_iterator
+hpDoFHandler<2>::last_raw_face (const unsigned int level) const {
+ return last_raw_line (level);
+}
+
+
+template <>
+hpDoFHandler<2>::face_iterator
+hpDoFHandler<2>::last_face () const {
+ return last_line ();
+}
+
+
+template <>
+hpDoFHandler<2>::face_iterator
+hpDoFHandler<2>::last_face (const unsigned int level) const {
+ return last_line (level);
+}
+
+
+template <>
+hpDoFHandler<2>::active_face_iterator
+hpDoFHandler<2>::last_active_face () const {
+ return last_active_line ();
+}
+
+
+template <>
+hpDoFHandler<2>::active_face_iterator
+hpDoFHandler<2>::last_active_face (const unsigned int level) const {
+ return last_active_line (level);
+}
+
+
+template <>
+hpDoFHandler<2>::raw_hex_iterator
+hpDoFHandler<2>::begin_raw_hex (const unsigned int) const {
+ Assert (false, ExcNotImplemented());
+ return 0;
+}
+
+
+template <>
+hpDoFHandler<2>::hex_iterator
+hpDoFHandler<2>::begin_hex (const unsigned int) const {
+ Assert (false, ExcNotImplemented());
+ return 0;
+}
+
+
+template <>
+hpDoFHandler<2>::active_hex_iterator
+hpDoFHandler<2>::begin_active_hex (const unsigned int) const {
+ Assert (false, ExcNotImplemented());
+ return 0;
+}
+
+
+template <>
+hpDoFHandler<2>::raw_hex_iterator
+hpDoFHandler<2>::end_hex () const {
+ Assert (false, ExcNotImplemented());
+ return 0;
+}
+
+
+template <>
+hpDoFHandler<2>::raw_hex_iterator
+hpDoFHandler<2>::last_raw_hex (const unsigned int) const {
+ Assert (false, ExcNotImplemented());
+ return 0;
+}
+
+
+template <>
+hpDoFHandler<2>::raw_hex_iterator
+hpDoFHandler<2>::last_raw_hex () const {
+ Assert (false, ExcNotImplemented());
+ return 0;
+}
+
+
+template <>
+hpDoFHandler<2>::hex_iterator
+hpDoFHandler<2>::last_hex (const unsigned int) const {
+ Assert (false, ExcNotImplemented());
+ return 0;
+}
+
+
+template <>
+hpDoFHandler<2>::hex_iterator
+hpDoFHandler<2>::last_hex () const {
+ Assert (false, ExcNotImplemented());
+ return 0;
+}
+
+
+template <>
+hpDoFHandler<2>::active_hex_iterator
+hpDoFHandler<2>::last_active_hex (const unsigned int) const {
+ Assert (false, ExcNotImplemented());
+ return 0;
+}
+
+
+template <>
+hpDoFHandler<2>::active_hex_iterator
+hpDoFHandler<2>::last_active_hex () const {
+ Assert (false, ExcNotImplemented());
+ return 0;
+}
+
+
+#endif
+
+
+#if deal_II_dimension == 3
+
+template <>
+hpDoFHandler<3>::raw_cell_iterator
+hpDoFHandler<3>::begin_raw (const unsigned int level) const {
+ return begin_raw_hex (level);
+}
+
+
+template <>
+hpDoFHandler<3>::cell_iterator
+hpDoFHandler<3>::begin (const unsigned int level) const {
+ return begin_hex (level);
+}
+
+
+template <>
+hpDoFHandler<3>::active_cell_iterator
+hpDoFHandler<3>::begin_active (const unsigned int level) const {
+ return begin_active_hex (level);
+}
+
+
+template <>
+hpDoFHandler<3>::raw_cell_iterator
+hpDoFHandler<3>::end () const {
+ return end_hex ();
+}
+
+
+template <>
+hpDoFHandler<3>::raw_cell_iterator
+hpDoFHandler<3>::last_raw () const {
+ return last_raw_hex ();
+}
+
+
+template <>
+hpDoFHandler<3>::raw_cell_iterator
+hpDoFHandler<3>::last_raw (const unsigned int level) const {
+ return last_raw_hex (level);
+}
+
+
+template <>
+hpDoFHandler<3>::cell_iterator
+hpDoFHandler<3>::last () const {
+ return last_hex ();
+}
+
+
+template <>
+hpDoFHandler<3>::cell_iterator
+hpDoFHandler<3>::last (const unsigned int level) const {
+ return last_hex (level);
+}
+
+
+template <>
+hpDoFHandler<3>::active_cell_iterator
+hpDoFHandler<3>::last_active () const {
+ return last_active_hex ();
+}
+
+
+template <>
+hpDoFHandler<3>::active_cell_iterator
+hpDoFHandler<3>::last_active (const unsigned int level) const {
+ return last_active_hex (level);
+}
+
+
+template <>
+hpDoFHandler<3>::raw_face_iterator
+hpDoFHandler<3>::begin_raw_face (const unsigned int level) const {
+ return begin_raw_quad (level);
+}
+
+
+template <>
+hpDoFHandler<3>::face_iterator
+hpDoFHandler<3>::begin_face (const unsigned int level) const {
+ return begin_quad (level);
+}
+
+
+template <>
+hpDoFHandler<3>::active_face_iterator
+hpDoFHandler<3>::begin_active_face (const unsigned int level) const {
+ return begin_active_quad (level);
+}
+
+
+template <>
+hpDoFHandler<3>::raw_face_iterator
+hpDoFHandler<3>::end_face () const {
+ return end_quad ();
+}
+
+
+template <>
+hpDoFHandler<3>::raw_face_iterator
+hpDoFHandler<3>::last_raw_face () const {
+ return last_raw_quad ();
+}
+
+
+template <>
+hpDoFHandler<3>::raw_face_iterator
+hpDoFHandler<3>::last_raw_face (const unsigned int level) const {
+ return last_raw_quad (level);
+}
+
+
+template <>
+hpDoFHandler<3>::face_iterator
+hpDoFHandler<3>::last_face () const {
+ return last_quad ();
+}
+
+
+template <>
+hpDoFHandler<3>::face_iterator
+hpDoFHandler<3>::last_face (const unsigned int level) const {
+ return last_quad (level);
+}
+
+
+template <>
+hpDoFHandler<3>::active_face_iterator
+hpDoFHandler<3>::last_active_face () const {
+ return last_active_quad ();
+}
+
+
+template <>
+hpDoFHandler<3>::active_face_iterator
+hpDoFHandler<3>::last_active_face (const unsigned int level) const {
+ return last_active_quad (level);
+}
+
+
+#endif
+
+
+template <int dim>
+typename hpDoFHandler<dim>::raw_line_iterator
+hpDoFHandler<dim>::begin_raw_line (const unsigned int level) const {
+ return raw_line_iterator (tria,
+ tria->begin_raw_line(level)->level(),
+ tria->begin_raw_line(level)->index(),
+ this);
+}
+
+
+template <int dim>
+typename hpDoFHandler<dim>::line_iterator
+hpDoFHandler<dim>::begin_line (const unsigned int level) const {
+ return line_iterator (tria,
+ tria->begin_line(level)->level(),
+ tria->begin_line(level)->index(),
+ this);
+}
+
+
+template <int dim>
+typename hpDoFHandler<dim>::active_line_iterator
+hpDoFHandler<dim>::begin_active_line (const unsigned int level) const {
+ return active_line_iterator (tria,
+ tria->begin_active_line(level)->level(),
+ tria->begin_active_line(level)->index(),
+ this);
+}
+
+
+template <int dim>
+typename hpDoFHandler<dim>::raw_quad_iterator
+hpDoFHandler<dim>::begin_raw_quad (const unsigned int level) const {
+ return raw_quad_iterator (tria,
+ tria->begin_raw_quad(level)->level(),
+ tria->begin_raw_quad(level)->index(),
+ this);
+}
+
+
+template <int dim>
+typename hpDoFHandler<dim>::quad_iterator
+hpDoFHandler<dim>::begin_quad (const unsigned int level) const {
+ return quad_iterator (tria,
+ tria->begin_quad(level)->level(),
+ tria->begin_quad(level)->index(),
+ this);
+}
+
+
+template <int dim>
+typename hpDoFHandler<dim>::active_quad_iterator
+hpDoFHandler<dim>::begin_active_quad (const unsigned int level) const {
+ return active_quad_iterator (tria,
+ tria->begin_active_quad(level)->level(),
+ tria->begin_active_quad(level)->index(),
+ this);
+}
+
+
+template <int dim>
+typename hpDoFHandler<dim>::raw_hex_iterator
+hpDoFHandler<dim>::begin_raw_hex (const unsigned int level) const {
+ return raw_hex_iterator (tria,
+ tria->begin_raw_hex(level)->level(),
+ tria->begin_raw_hex(level)->index(),
+ this);
+}
+
+
+template <int dim>
+typename hpDoFHandler<dim>::hex_iterator
+hpDoFHandler<dim>::begin_hex (const unsigned int level) const {
+ return hex_iterator (tria,
+ tria->begin_hex(level)->level(),
+ tria->begin_hex(level)->index(),
+ this);
+}
+
+
+template <int dim>
+typename hpDoFHandler<dim>::active_hex_iterator
+hpDoFHandler<dim>::begin_active_hex (const unsigned int level) const {
+ return active_hex_iterator (tria,
+ tria->begin_active_hex(level)->level(),
+ tria->begin_active_hex(level)->index(),
+ this);
+}
+
+
+template <int dim>
+typename hpDoFHandler<dim>::raw_line_iterator
+hpDoFHandler<dim>::end_line () const {
+ return raw_line_iterator (tria, -1, -1, this);
+}
+
+
+template <int dim>
+typename hpDoFHandler<dim>::raw_quad_iterator
+hpDoFHandler<dim>::end_quad () const {
+ return raw_quad_iterator (tria, -1, -1, this);
+}
+
+
+template <int dim>
+typename hpDoFHandler<dim>::raw_hex_iterator
+hpDoFHandler<dim>::end_hex () const {
+ return raw_hex_iterator (tria, -1, -1, this);
+}
+
+
+template <int dim>
+typename hpDoFHandler<dim>::raw_cell_iterator
+hpDoFHandler<dim>::end_raw (const unsigned int level) const {
+ return (level == levels.size()-1 ?
+ end() :
+ begin_raw (level+1));
+}
+
+
+template <int dim>
+typename hpDoFHandler<dim>::cell_iterator
+hpDoFHandler<dim>::end (const unsigned int level) const {
+ return (level == levels.size()-1 ?
+ cell_iterator(end()) :
+ begin (level+1));
+}
+
+
+template <int dim>
+typename hpDoFHandler<dim>::active_cell_iterator
+hpDoFHandler<dim>::end_active (const unsigned int level) const {
+ return (level == levels.size()-1 ?
+ active_cell_iterator(end()) :
+ begin_active (level+1));
+}
+
+
+template <int dim>
+typename hpDoFHandler<dim>::raw_face_iterator
+hpDoFHandler<dim>::end_raw_face (const unsigned int level) const {
+ return (level == levels.size()-1 ?
+ end_face() :
+ begin_raw_face (level+1));
+}
+
+
+template <int dim>
+typename hpDoFHandler<dim>::face_iterator
+hpDoFHandler<dim>::end_face (const unsigned int level) const {
+ return (level == levels.size()-1 ?
+ face_iterator(end_face()) :
+ begin_face (level+1));
+}
+
+
+template <int dim>
+typename hpDoFHandler<dim>::active_face_iterator
+hpDoFHandler<dim>::end_active_face (const unsigned int level) const {
+ return (level == levels.size()-1 ?
+ active_face_iterator(end_face()) :
+ begin_active_face (level+1));
+}
+
+
+template <int dim>
+typename hpDoFHandler<dim>::raw_line_iterator
+hpDoFHandler<dim>::end_raw_line (const unsigned int level) const {
+ return (level == levels.size()-1 ?
+ end_line() :
+ begin_raw_line (level+1));
+}
+
+
+template <int dim>
+typename hpDoFHandler<dim>::line_iterator
+hpDoFHandler<dim>::end_line (const unsigned int level) const {
+ return (level == levels.size()-1 ?
+ line_iterator(end_line()) :
+ begin_line (level+1));
+}
+
+
+template <int dim>
+typename hpDoFHandler<dim>::active_line_iterator
+hpDoFHandler<dim>::end_active_line (const unsigned int level) const {
+ return (level == levels.size()-1 ?
+ active_line_iterator(end_line()) :
+ begin_active_line (level+1));
+}
+
+
+template <int dim>
+typename hpDoFHandler<dim>::raw_quad_iterator
+hpDoFHandler<dim>::end_raw_quad (const unsigned int level) const {
+ return (level == levels.size()-1 ?
+ end_quad() :
+ begin_raw_quad (level+1));
+}
+
+
+template <int dim>
+typename hpDoFHandler<dim>::quad_iterator
+hpDoFHandler<dim>::end_quad (const unsigned int level) const {
+ return (level == levels.size()-1 ?
+ quad_iterator(end_quad()) :
+ begin_quad (level+1));
+}
+
+
+template <int dim>
+typename hpDoFHandler<dim>::active_quad_iterator
+hpDoFHandler<dim>::end_active_quad (const unsigned int level) const {
+ return (level == levels.size()-1 ?
+ active_quad_iterator(end_quad()) :
+ begin_active_quad (level+1));
+}
+
+
+template <int dim>
+typename hpDoFHandler<dim>::raw_hex_iterator
+hpDoFHandler<dim>::end_raw_hex (const unsigned int level) const {
+ return (level == levels.size()-1 ?
+ end_hex() :
+ begin_raw_hex (level+1));
+}
+
+
+template <int dim>
+typename hpDoFHandler<dim>::hex_iterator
+hpDoFHandler<dim>::end_hex (const unsigned int level) const {
+ return (level == levels.size()-1 ?
+ hex_iterator(end_hex()) :
+ begin_hex (level+1));
+}
+
+
+template <int dim>
+typename hpDoFHandler<dim>::active_hex_iterator
+hpDoFHandler<dim>::end_active_hex (const unsigned int level) const {
+ return (level == levels.size()-1 ?
+ active_hex_iterator(end_hex()) :
+ begin_active_hex (level+1));
+}
+
+
+template <int dim>
+typename hpDoFHandler<dim>::raw_line_iterator
+hpDoFHandler<dim>::last_raw_line (const unsigned int level) const {
+ return raw_line_iterator (tria,
+ tria->last_raw_line(level)->level(),
+ tria->last_raw_line(level)->index(),
+ this);
+}
+
+
+template <int dim>
+typename hpDoFHandler<dim>::line_iterator
+hpDoFHandler<dim>::last_line (const unsigned int level) const {
+ return line_iterator (tria,
+ tria->last_line(level)->level(),
+ tria->last_line(level)->index(),
+ this);
+}
+
+
+template <int dim>
+typename hpDoFHandler<dim>::active_line_iterator
+hpDoFHandler<dim>::last_active_line (const unsigned int level) const {
+ return active_line_iterator (tria,
+ tria->last_active_line(level)->level(),
+ tria->last_active_line(level)->index(),
+ this);
+}
+
+
+template <int dim>
+typename hpDoFHandler<dim>::raw_quad_iterator
+hpDoFHandler<dim>::last_raw_quad (const unsigned int level) const {
+ return raw_quad_iterator (tria,
+ tria->last_raw_quad(level)->level(),
+ tria->last_raw_quad(level)->index(),
+ this);
+}
+
+
+template <int dim>
+typename hpDoFHandler<dim>::quad_iterator
+hpDoFHandler<dim>::last_quad (const unsigned int level) const {
+ return quad_iterator (tria,
+ tria->last_quad(level)->level(),
+ tria->last_quad(level)->index(),
+ this);
+}
+
+
+template <int dim>
+typename hpDoFHandler<dim>::active_quad_iterator
+hpDoFHandler<dim>::last_active_quad (const unsigned int level) const {
+ return active_quad_iterator (tria,
+ tria->last_active_quad(level)->level(),
+ tria->last_active_quad(level)->index(),
+ this);
+}
+
+
+template <int dim>
+typename hpDoFHandler<dim>::raw_hex_iterator
+hpDoFHandler<dim>::last_raw_hex (const unsigned int level) const {
+ return raw_hex_iterator (tria,
+ tria->last_raw_hex(level)->level(),
+ tria->last_raw_hex(level)->index(),
+ this);
+}
+
+
+template <int dim>
+typename hpDoFHandler<dim>::hex_iterator
+hpDoFHandler<dim>::last_hex (const unsigned int level) const {
+ return hex_iterator (tria,
+ tria->last_hex(level)->level(),
+ tria->last_hex(level)->index(),
+ this);
+}
+
+
+template <int dim>
+typename hpDoFHandler<dim>::active_hex_iterator
+hpDoFHandler<dim>::last_active_hex (const unsigned int level) const {
+ return active_hex_iterator (tria,
+ tria->last_active_hex(level)->level(),
+ tria->last_active_hex(level)->index(),
+ this);
+}
+
+
+template <int dim>
+typename hpDoFHandler<dim>::raw_line_iterator
+hpDoFHandler<dim>::last_raw_line () const {
+ return last_raw_line (levels.size()-1);
+}
+
+
+template <int dim>
+typename hpDoFHandler<dim>::raw_quad_iterator
+hpDoFHandler<dim>::last_raw_quad () const {
+ return last_raw_quad (levels.size()-1);
+}
+
+
+template <int dim>
+typename hpDoFHandler<dim>::raw_hex_iterator
+hpDoFHandler<dim>::last_raw_hex () const {
+ return last_raw_hex (levels.size()-1);
+}
+
+
+template <int dim>
+typename hpDoFHandler<dim>::line_iterator
+hpDoFHandler<dim>::last_line () const {
+ return last_line (levels.size()-1);
+}
+
+
+template <int dim>
+typename hpDoFHandler<dim>::quad_iterator
+hpDoFHandler<dim>::last_quad () const {
+ return last_quad (levels.size()-1);
+}
+
+
+template <int dim>
+typename hpDoFHandler<dim>::hex_iterator
+hpDoFHandler<dim>::last_hex () const {
+ return last_hex (levels.size()-1);
+}
+
+
+template <int dim>
+typename hpDoFHandler<dim>::active_line_iterator
+hpDoFHandler<dim>::last_active_line () const {
+ return last_active_line (levels.size()-1);
+}
+
+
+template <int dim>
+typename hpDoFHandler<dim>::active_quad_iterator
+hpDoFHandler<dim>::last_active_quad () const {
+ return last_active_quad (levels.size()-1);
+}
+
+
+template <int dim>
+typename hpDoFHandler<dim>::active_hex_iterator
+hpDoFHandler<dim>::last_active_hex () const {
+ return last_active_hex (levels.size()-1);
+}
+
+
+//------------------------------------------------------------------
+
+
+
+#if deal_II_dimension == 1
+
+template <>
+unsigned int hpDoFHandler<1>::n_boundary_dofs () const
+{
+ Assert (finite_elements != 0, ExcNoFESelected());
+
+ hpDoFHandler<1>::cell_iterator cell;
+ unsigned int n = 0;
+
+ // search left-most cell
+ cell = this->begin_active();
+ while (!cell->at_boundary(0))
+ cell = cell->neighbor(0);
+ n += cell->get_fe().dofs_per_vertex;
+
+ // same with right-most cell
+ cell = this->begin_active();
+ while (!cell->at_boundary(1))
+ cell = cell->neighbor(1);
+ n += cell->get_fe().dofs_per_vertex;
+
+ return n;
+}
+
+
+
+template <>
+unsigned int hpDoFHandler<1>::n_boundary_dofs (const FunctionMap &boundary_indicators) const
+{
+ Assert (finite_elements != 0, ExcNoFESelected());
+
+ // check that only boundary
+ // indicators 0 and 1 are allowed
+ // in 1d
+ for (FunctionMap::const_iterator i=boundary_indicators.begin();
+ i!=boundary_indicators.end(); ++i)
+ Assert ((i->first == 0) || (i->first == 1),
+ ExcInvalidBoundaryIndicator());
+
+ hpDoFHandler<1>::active_cell_iterator cell;
+ unsigned int n = 0;
+
+ // search left-most cell
+ if (boundary_indicators.find (0) != boundary_indicators.end())
+ {
+ cell = this->begin_active();
+ while (!cell->at_boundary(0))
+ cell = cell->neighbor(0);
+ n += cell->get_fe().dofs_per_vertex;
+ }
+
+ // same with right-most cell
+ if (boundary_indicators.find (1) != boundary_indicators.end())
+ {
+ cell = this->begin_active();
+ while (!cell->at_boundary(1))
+ cell = cell->neighbor(1);
+ n += cell->get_fe().dofs_per_vertex;
+ }
+
+ return n;
+}
+
+
+
+template <>
+unsigned int hpDoFHandler<1>::n_boundary_dofs (const std::set<unsigned char> &boundary_indicators) const
+{
+ Assert (finite_elements != 0, ExcNoFESelected());
+
+ // check that only boundary
+ // indicators 0 and 1 are allowed
+ // in 1d
+ for (std::set<unsigned char>::const_iterator i=boundary_indicators.begin();
+ i!=boundary_indicators.end(); ++i)
+ Assert ((*i == 0) || (*i == 1),
+ ExcInvalidBoundaryIndicator());
+
+ hpDoFHandler<1>::active_cell_iterator cell;
+ unsigned int n = 0;
+
+ // search left-most cell
+ if (boundary_indicators.find (0) != boundary_indicators.end())
+ {
+ cell = this->begin_active();
+ while (!cell->at_boundary(0))
+ cell = cell->neighbor(0);
+ n += cell->get_fe().dofs_per_vertex;
+ }
+
+ // same with right-most cell
+ if (boundary_indicators.find (1) != boundary_indicators.end())
+ {
+ cell = this->begin_active();
+ while (!cell->at_boundary(1))
+ cell = cell->neighbor(1);
+ n += cell->get_fe().dofs_per_vertex;
+ }
+
+ return n;
+}
+
+#endif
+
+
+template <int dim>
+unsigned int hpDoFHandler<dim>::n_boundary_dofs () const
+{
+ Assert (finite_elements != 0, ExcNoFESelected());
+
+ std::set<int> boundary_dofs;
+ std::vector<unsigned int> dofs_on_face;
+ dofs_on_face.reserve (this->get_fe ().max_dofs_per_face());
+
+ // loop over all faces to check
+ // whether they are at a
+ // boundary. note that we need not
+ // take special care of single
+ // lines in 3d (using
+ // @p{cell->has_boundary_lines}),
+ // since we do not support
+ // boundaries of dimension dim-2,
+ // and so every boundary line is
+ // also part of a boundary face.
+ typename hpDoFHandler<dim>::active_cell_iterator cell = this->begin_active (),
+ endc = this->end();
+ for (; cell!=endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ if (cell->at_boundary(f))
+ {
+ const unsigned int dofs_per_face = cell->get_fe().dofs_per_face;
+ dofs_on_face.resize (dofs_per_face);
+
+ cell->face(f)->get_dof_indices (dofs_on_face);
+ for (unsigned int i=0; i<dofs_per_face; ++i)
+ boundary_dofs.insert(dofs_on_face[i]);
+ };
+ return boundary_dofs.size();
+}
+
+
+
+template <int dim>
+unsigned int
+hpDoFHandler<dim>::n_boundary_dofs (const FunctionMap &boundary_indicators) const
+{
+ Assert (finite_elements != 0, ExcNoFESelected());
+ Assert (boundary_indicators.find(255) == boundary_indicators.end(),
+ ExcInvalidBoundaryIndicator());
+
+ // same as above, but with
+ // additional checks for set of
+ // boundary indicators
+ std::set<int> boundary_dofs;
+ std::vector<unsigned int> dofs_on_face;
+ dofs_on_face.reserve (this->get_fe ().max_dofs_per_face());
+
+ typename hpDoFHandler<dim>::active_cell_iterator cell = this->begin_active (),
+ endc = this->end();
+ for (; cell!=endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ if (cell->at_boundary(f) &&
+ (boundary_indicators.find(cell->face(f)->boundary_indicator()) !=
+ boundary_indicators.end()))
+ {
+ const unsigned int dofs_per_face = cell->get_fe().dofs_per_face;
+ dofs_on_face.resize (dofs_per_face);
+
+ cell->face(f)->get_dof_indices (dofs_on_face);
+ for (unsigned int i=0; i<dofs_per_face; ++i)
+ boundary_dofs.insert(dofs_on_face[i]);
+ };
+ return boundary_dofs.size();
+}
+
+
+
+template <int dim>
+unsigned int
+hpDoFHandler<dim>::n_boundary_dofs (const std::set<unsigned char> &boundary_indicators) const
+{
+ Assert (finite_elements != 0, ExcNoFESelected());
+ Assert (boundary_indicators.find (255) == boundary_indicators.end(),
+ ExcInvalidBoundaryIndicator());
+
+ // same as above, but with
+ // additional checks for set of
+ // boundary indicators
+ std::set<int> boundary_dofs;
+ std::vector<unsigned int> dofs_on_face;
+ dofs_on_face.reserve (this->get_fe ().max_dofs_per_face());
+
+ typename hpDoFHandler<dim>::active_cell_iterator cell = this->begin_active (),
+ endc = this->end();
+ for (; cell!=endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ if (cell->at_boundary(f) &&
+ (boundary_indicators.find(cell->face(f)->boundary_indicator()) !=
+ boundary_indicators.end()))
+ {
+ const unsigned int dofs_per_face = cell->get_fe().dofs_per_face;
+ dofs_on_face.resize (dofs_per_face);
+
+ cell->face(f)->get_dof_indices (dofs_on_face);
+ for (unsigned int i=0; i<dofs_per_face; ++i)
+ boundary_dofs.insert(dofs_on_face[i]);
+ };
+ return boundary_dofs.size();
+}
+
+
+template <int dim>
+unsigned int
+hpDoFHandler<dim>::memory_consumption () const
+{
+ unsigned int mem = (MemoryConsumption::memory_consumption (tria) +
+ MemoryConsumption::memory_consumption (finite_elements) +
+ MemoryConsumption::memory_consumption (tria) +
+ MemoryConsumption::memory_consumption (levels) +
+ MemoryConsumption::memory_consumption (used_dofs) +
+ MemoryConsumption::memory_consumption (vertex_dofs));
+ for (unsigned int i=0; i<levels.size(); ++i)
+ mem += MemoryConsumption::memory_consumption (*levels[i]);
+
+ return mem;
+}
+
+
+
+template <int dim>
+void hpDoFHandler<dim>::distribute_dofs (const FECollection<dim> &ff)
+{
+ Assert (tria->n_levels() > 0, ExcInvalidTriangulation());
+
+ finite_elements = &ff;
+
+ // This call ensures, the active_fe_indices
+ // vectors are initialized correctly.
+ create_active_fe_table ();
+
+ reserve_space ();
+
+ // Clear user flags because we will
+ // need them. But first we save
+ // them and make sure that we
+ // restore them later such that at
+ // the end of this function the
+ // Triangulation will be in the
+ // same state as it was at the
+ // beginning of this function.
+ std::vector<bool> user_flags;
+ tria->save_user_flags(user_flags);
+ const_cast<Triangulation<dim> &>(*tria).clear_user_flags ();
+
+ unsigned int next_free_dof = 0;
+ active_cell_iterator cell = begin_active(),
+ endc = end();
+
+ for (; cell != endc; ++cell)
+ next_free_dof = distribute_dofs_on_cell (cell, next_free_dof);
+
+ used_dofs = next_free_dof;
+
+ // finally restore the user flags
+ const_cast<Triangulation<dim> &>(*tria).load_user_flags(user_flags);
+}
+
+
+template <int dim>
+void hpDoFHandler<dim>::clear ()
+{
+ // release lock to old fe
+ finite_elements = 0;
+
+ // release memory
+ clear_space ();
+}
+
+
+#if deal_II_dimension == 1
+
+template <>
+unsigned int
+hpDoFHandler<1>::distribute_dofs_on_cell (active_cell_iterator &cell,
+ unsigned int next_free_dof)
+{
+ // get the fe for this cell
+ const FiniteElement<1> &fe = cell->get_fe();
+
+ // distribute dofs of vertices
+ for (unsigned int v=0; v<GeometryInfo<1>::vertices_per_cell; ++v)
+ {
+ cell_iterator neighbor = cell->neighbor(v);
+
+ if (neighbor.state() == IteratorState::valid)
+ {
+ // find true neighbor; may be its
+ // a child of @p{neighbor}
+ while (neighbor->has_children())
+ neighbor = neighbor->child(v==0 ? 1 : 0);
+
+ // has neighbor already been processed?
+ if (neighbor->user_flag_set())
+ // copy dofs
+ {
+ if (v==0)
+ for (unsigned int d=0; d<fe.dofs_per_vertex; ++d)
+ cell->set_vertex_dof_index (0, d,
+ neighbor->vertex_dof_index (1, d));
+ else
+ for (unsigned int d=0; d<fe.dofs_per_vertex; ++d)
+ cell->set_vertex_dof_index (1, d,
+ neighbor->vertex_dof_index (0, d));
+
+ // next neighbor
+ continue;
+ };
+ };
+
+ // otherwise: create dofs newly
+ for (unsigned int d=0; d<fe.dofs_per_vertex; ++d)
+ cell->set_vertex_dof_index (v, d, next_free_dof++);
+ };
+
+ // dofs of line
+ for (unsigned int d=0; d<fe.dofs_per_line; ++d)
+ cell->set_dof_index (d, next_free_dof++);
+
+ // note that this cell has been processed
+ cell->set_user_flag ();
+
+ return next_free_dof;
+}
+
+#endif
+
+
+#if deal_II_dimension == 2
+
+template <>
+unsigned int
+hpDoFHandler<2>::distribute_dofs_on_cell (active_cell_iterator &cell,
+ unsigned int next_free_dof)
+{
+ // get the fe for this cell
+ const FiniteElement<2> &fe = cell->get_fe();
+
+ if (fe.dofs_per_vertex > 0)
+ // number dofs on vertices
+ for (unsigned int vertex=0; vertex<GeometryInfo<2>::vertices_per_cell; ++vertex)
+ // check whether dofs for this
+ // vertex have been distributed
+ // (only check the first dof)
+ if (cell->vertex_dof_index(vertex, 0) == invalid_dof_index)
+ for (unsigned int d=0; d<fe.dofs_per_vertex; ++d)
+ cell->set_vertex_dof_index (vertex, d, next_free_dof++);
+
+ // for the four sides
+//TODO[?] Does not work for continuous FEs
+ if (fe.dofs_per_line > 0)
+ for (unsigned int side=0; side<GeometryInfo<2>::faces_per_cell; ++side)
+ {
+ line_iterator line = cell->line(side);
+
+ // distribute dofs if necessary:
+ // check whether line dof is already
+ // numbered (check only first dof)
+ if (line->dof_index(0) == invalid_dof_index)
+ // if not: distribute dofs
+ for (unsigned int d=0; d<fe.dofs_per_line; ++d)
+ line->set_dof_index (d, next_free_dof++);
+ };
+
+
+ // dofs of quad
+ if (fe.dofs_per_quad > 0)
+ for (unsigned int d=0; d<fe.dofs_per_quad; ++d)
+ cell->set_dof_index (d, next_free_dof++);
+
+
+ // note that this cell has been processed
+ cell->set_user_flag ();
+
+ return next_free_dof;
+}
+
+#endif
+
+
+#if deal_II_dimension == 3
+
+template <>
+unsigned int
+hpDoFHandler<3>::distribute_dofs_on_cell (active_cell_iterator &cell,
+ unsigned int next_free_dof)
+{
+ // get the fe for this cell
+ const FiniteElement<3> &fe = cell->get_fe();
+
+ if (fe.dofs_per_vertex > 0)
+ // number dofs on vertices
+ for (unsigned int vertex=0; vertex<GeometryInfo<3>::vertices_per_cell; ++vertex)
+ // check whether dofs for this
+ // vertex have been distributed
+ // (only check the first dof)
+ if (cell->vertex_dof_index(vertex, 0) == invalid_dof_index)
+ for (unsigned int d=0; d<fe.dofs_per_vertex; ++d)
+ cell->set_vertex_dof_index (vertex, d, next_free_dof++);
+
+ // for the lines
+ if (fe.dofs_per_line > 0)
+ for (unsigned int l=0; l<GeometryInfo<3>::lines_per_cell; ++l)
+ {
+ line_iterator line = cell->line(l);
+
+ // distribute dofs if necessary:
+ // check whether line dof is already
+ // numbered (check only first dof)
+ if (line->dof_index(0) == invalid_dof_index)
+ // if not: distribute dofs
+ for (unsigned int d=0; d<fe.dofs_per_line; ++d)
+ line->set_dof_index (d, next_free_dof++);
+ };
+
+ // for the quads
+ if (fe.dofs_per_quad > 0)
+ for (unsigned int q=0; q<GeometryInfo<3>::quads_per_cell; ++q)
+ {
+ quad_iterator quad = cell->quad(q);
+
+ // distribute dofs if necessary:
+ // check whether quad dof is already
+ // numbered (check only first dof)
+ if (quad->dof_index(0) == invalid_dof_index)
+ // if not: distribute dofs
+ for (unsigned int d=0; d<fe.dofs_per_quad; ++d)
+ quad->set_dof_index (d, next_free_dof++);
+ };
+
+
+ // dofs of hex
+ if (fe.dofs_per_hex > 0)
+ for (unsigned int d=0; d<fe.dofs_per_hex; ++d)
+ cell->set_dof_index (d, next_free_dof++);
+
+
+ // note that this cell has been processed
+ cell->set_user_flag ();
+
+ return next_free_dof;
+}
+
+#endif
+
+
+#if deal_II_dimension == 1
+
+template <>
+void hpDoFHandler<1>::renumber_dofs (const std::vector<unsigned int> &new_numbers)
+{
+ Assert (new_numbers.size() == n_dofs(), ExcRenumberingIncomplete());
+#ifdef DEBUG
+ // assert that the new indices are
+ // consecutively numbered
+ if (true)
+ {
+ std::vector<unsigned int> tmp(new_numbers);
+ std::sort (tmp.begin(), tmp.end());
+ std::vector<unsigned int>::const_iterator p = tmp.begin();
+ unsigned int i = 0;
+ for (; p!=tmp.end(); ++p, ++i)
+ Assert (*p == i, ExcNewNumbersNotConsecutive(i));
+ };
+#endif
+
+ // note that we can not use cell iterators
+ // in this function since then we would
+ // renumber the dofs on the interface of
+ // two cells more than once. Anyway, this
+ // way it's not only more correct but also
+ // faster; note, however, that dof numbers
+ // may be invalid_dof_index, namely when the appropriate
+ // vertex/line/etc is unused
+ for (std::vector<unsigned int>::iterator i=vertex_dofs.begin(); i!=vertex_dofs.end(); ++i)
+ if (*i != invalid_dof_index)
+ *i = new_numbers[*i];
+
+ for (unsigned int level=0; level<levels.size(); ++level)
+ for (std::vector<unsigned int>::iterator i=levels[level]->line_dofs.begin();
+ i!=levels[level]->line_dofs.end(); ++i)
+ if (*i != invalid_dof_index)
+ *i = new_numbers[*i];
+}
+
+#endif
+
+
+#if deal_II_dimension == 2
+
+template <>
+void hpDoFHandler<2>::renumber_dofs (const std::vector<unsigned int> &new_numbers)
+{
+ Assert (new_numbers.size() == n_dofs(), ExcRenumberingIncomplete());
+#ifdef DEBUG
+ // assert that the new indices are
+ // consecutively numbered
+ if (true)
+ {
+ std::vector<unsigned int> tmp(new_numbers);
+ std::sort (tmp.begin(), tmp.end());
+ std::vector<unsigned int>::const_iterator p = tmp.begin();
+ unsigned int i = 0;
+ for (; p!=tmp.end(); ++p, ++i)
+ Assert (*p == i, ExcNewNumbersNotConsecutive(i));
+ };
+#endif
+
+ // note that we can not use cell iterators
+ // in this function since then we would
+ // renumber the dofs on the interface of
+ // two cells more than once. Anyway, this
+ // way it's not only more correct but also
+ // faster; note, however, that dof numbers
+ // may be invalid_dof_index, namely when the appropriate
+ // vertex/line/etc is unused
+ for (std::vector<unsigned int>::iterator i=vertex_dofs.begin(); i!=vertex_dofs.end(); ++i)
+ if (*i != invalid_dof_index)
+ *i = new_numbers[*i];
+
+ for (unsigned int level=0; level<levels.size(); ++level)
+ {
+ for (std::vector<unsigned int>::iterator i=levels[level]->line_dofs.begin();
+ i!=levels[level]->line_dofs.end(); ++i)
+ if (*i != invalid_dof_index)
+ *i = new_numbers[*i];
+ for (std::vector<unsigned int>::iterator i=levels[level]->quad_dofs.begin();
+ i!=levels[level]->quad_dofs.end(); ++i)
+ if (*i != invalid_dof_index)
+ *i = new_numbers[*i];
+ };
+}
+
+#endif
+
+
+#if deal_II_dimension == 3
+
+template <>
+void hpDoFHandler<3>::renumber_dofs (const std::vector<unsigned int> &new_numbers)
+{
+ Assert (new_numbers.size() == n_dofs(), ExcRenumberingIncomplete());
+#ifdef DEBUG
+ // assert that the new indices are
+ // consecutively numbered
+ if (true)
+ {
+ std::vector<unsigned int> tmp(new_numbers);
+ std::sort (tmp.begin(), tmp.end());
+ std::vector<unsigned int>::const_iterator p = tmp.begin();
+ unsigned int i = 0;
+ for (; p!=tmp.end(); ++p, ++i)
+ Assert (*p == i, ExcNewNumbersNotConsecutive(i));
+ };
+#endif
+
+ // note that we can not use cell iterators
+ // in this function since then we would
+ // renumber the dofs on the interface of
+ // two cells more than once. Anyway, this
+ // way it's not only more correct but also
+ // faster; note, however, that dof numbers
+ // may be invalid_dof_index, namely when the appropriate
+ // vertex/line/etc is unused
+ for (std::vector<unsigned int>::iterator i=vertex_dofs.begin(); i!=vertex_dofs.end(); ++i)
+ if (*i != invalid_dof_index)
+ *i = new_numbers[*i];
+
+ for (unsigned int level=0; level<levels.size(); ++level)
+ {
+ for (std::vector<unsigned int>::iterator i=levels[level]->line_dofs.begin();
+ i!=levels[level]->line_dofs.end(); ++i)
+ if (*i != invalid_dof_index)
+ *i = new_numbers[*i];
+ for (std::vector<unsigned int>::iterator i=levels[level]->quad_dofs.begin();
+ i!=levels[level]->quad_dofs.end(); ++i)
+ if (*i != invalid_dof_index)
+ *i = new_numbers[*i];
+ for (std::vector<unsigned int>::iterator i=levels[level]->hex_dofs.begin();
+ i!=levels[level]->hex_dofs.end(); ++i)
+ if (*i != invalid_dof_index)
+ *i = new_numbers[*i];
+ };
+}
+
+#endif
+
+
+#if deal_II_dimension == 1
+
+template <>
+unsigned int
+hpDoFHandler<1>::max_couplings_between_dofs () const
+{
+ Assert (finite_elements != 0, ExcNoFESelected());
+ return std::min(3*finite_elements->max_dofs_per_vertex() +
+ 2*finite_elements->max_dofs_per_line(), n_dofs());
+}
+
+
+
+template <>
+unsigned int
+hpDoFHandler<1>::max_couplings_between_boundary_dofs () const
+{
+ Assert (finite_elements != 0, ExcNoFESelected());
+ return finite_elements->max_dofs_per_vertex();
+}
+
+#endif
+
+
+#if deal_II_dimension == 2
+
+template <>
+unsigned int
+hpDoFHandler<2>::max_couplings_between_dofs () const
+{
+ Assert (finite_elements != 0, ExcNoFESelected());
+
+ // get these numbers by drawing pictures
+ // and counting...
+ // example:
+ // | | |
+ // --x-----x--x--X--
+ // | | | |
+ // | x--x--x
+ // | | | |
+ // --x--x--*--x--x--
+ // | | | |
+ // x--x--x |
+ // | | | |
+ // --X--x--x-----x--
+ // | | |
+ // x = vertices connected with center vertex *;
+ // = total of 19
+ // (the X vertices are connected with * if
+ // the vertices adjacent to X are hanging
+ // nodes)
+ // count lines -> 28 (don't forget to count
+ // mother and children separately!)
+ unsigned int max_couplings;
+ switch (tria->max_adjacent_cells())
+ {
+ case 4:
+ max_couplings=19*finite_elements->max_dofs_per_vertex() +
+ 28*finite_elements->max_dofs_per_line() +
+ 8*finite_elements->max_dofs_per_quad();
+ break;
+ case 5:
+ max_couplings=21*finite_elements->max_dofs_per_vertex() +
+ 31*finite_elements->max_dofs_per_line() +
+ 9*finite_elements->max_dofs_per_quad();
+ break;
+ case 6:
+ max_couplings=28*finite_elements->max_dofs_per_vertex() +
+ 42*finite_elements->max_dofs_per_line() +
+ 12*finite_elements->max_dofs_per_quad();
+ break;
+ case 7:
+ max_couplings=30*finite_elements->max_dofs_per_vertex() +
+ 45*finite_elements->max_dofs_per_line() +
+ 13*finite_elements->max_dofs_per_quad();
+ break;
+ case 8:
+ max_couplings=37*finite_elements->max_dofs_per_vertex() +
+ 56*finite_elements->max_dofs_per_line() +
+ 16*finite_elements->max_dofs_per_quad();
+ break;
+ default:
+ Assert (false, ExcNotImplemented());
+ max_couplings=0;
+ };
+ return std::min(max_couplings,n_dofs());
+}
+
+
+
+template <>
+unsigned int
+hpDoFHandler<2>::max_couplings_between_boundary_dofs () const
+{
+ Assert (finite_elements != 0, ExcNoFESelected());
+ return (3*finite_elements->max_dofs_per_vertex()
+ +
+ 2*finite_elements->max_dofs_per_line());
+}
+
+#endif
+
+
+#if deal_II_dimension == 3
+
+template <>
+unsigned int
+hpDoFHandler<3>::max_couplings_between_dofs () const
+{
+//TODO:[?] Invent significantly better estimates than the ones in this function
+ Assert (finite_elements != 0, ExcNoFESelected());
+
+ // doing the same thing here is a rather
+ // complicated thing, compared to the 2d
+ // case, since it is hard to draw pictures
+ // with several refined hexahedra :-) so I
+ // presently only give a coarse estimate
+ // for the case that at most 8 hexes meet
+ // at each vertex
+ //
+ // can anyone give better estimate here?
+ const unsigned int max_adjacent_cells = tria->max_adjacent_cells();
+
+ unsigned int max_couplings;
+ if (max_adjacent_cells <= 8)
+ max_couplings=7*7*7*finite_elements->max_dofs_per_vertex() +
+ 7*6*7*3*finite_elements->max_dofs_per_line() +
+ 9*4*7*3*finite_elements->max_dofs_per_quad() +
+ 27*finite_elements->max_dofs_per_hex();
+ else
+ {
+ Assert (false, ExcNotImplemented());
+ max_couplings=0;
+ }
+
+ return std::min(max_couplings,n_dofs());
+}
+
+
+template <>
+unsigned int
+hpDoFHandler<3>::max_couplings_between_boundary_dofs () const
+{
+ Assert (finite_elements != 0, ExcNoFESelected());
+ // we need to take refinement of
+ // one boundary face into consideration
+ // here; in fact, this function returns
+ // what #max_coupling_between_dofs<2>
+ // returns
+ //
+ // we assume here, that only four faces
+ // meet at the boundary; this assumption
+ // is not justified and needs to be
+ // fixed some time. fortunately, ommitting
+ // it for now does no harm since the
+ // matrix will cry foul if its requirements
+ // are not satisfied
+ return (19*finite_elements->max_dofs_per_vertex() +
+ 28*finite_elements->max_dofs_per_line() +
+ 8*finite_elements->max_dofs_per_quad());
+}
+
+
+#endif
+
+
+
+#if deal_II_dimension == 1
+
+template <>
+void hpDoFHandler<1>::reserve_space ()
+{
+//TODO: This presently works only on the first FE of the FECollection. Fix this
+ Assert (finite_elements != 0, ExcNoFESelected());
+ Assert (tria->n_levels() > 0, ExcInvalidTriangulation());
+ Assert (tria->n_levels() == levels.size (), ExcInternalError ());
+
+ // Backup the active_fe_indices vectors.
+ // The user might have put something
+ // important in them.
+ std::vector<std::vector<unsigned int> > active_fe_backup(levels.size ());
+ for (unsigned int i = 0; i < levels.size (); ++i)
+ std::swap (levels[i]->active_fe_indices, active_fe_backup[i]);
+
+ // delete all levels and set them up
+ // newly, since vectors are
+ // troublesome if you want to change
+ // their size
+ clear_space ();
+
+ vertex_dofs.resize(tria->vertices.size()*finite_elements->get_fe(0).dofs_per_vertex,
+ invalid_dof_index);
+
+ for (unsigned int i=0; i<tria->n_levels(); ++i)
+ {
+ levels.push_back (new hpDoFLevel<1>);
+ std::swap (active_fe_backup[i], levels.back()->active_fe_indices);
+
+ levels.back()->dof_line_index_offset = std::vector<unsigned int>
+ (tria->levels[i]->lines.lines.size (),static_cast<unsigned int>(-1));
+ unsigned int dofs_for_lines = 0;
+ 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;
+ }
+
+ levels.back()->line_dofs = std::vector<unsigned int>(dofs_for_lines,
+ invalid_dof_index);
+ };
+}
+
+
+#endif
+
+
+#if deal_II_dimension == 2
+
+template <>
+void hpDoFHandler<2>::reserve_space ()
+{
+//TODO: This presently works only on the first FE of the FECollection. Fix this
+ Assert (finite_elements != 0, ExcNoFESelected());
+ Assert (tria->n_levels() > 0, ExcInvalidTriangulation());
+ Assert (tria->n_levels() == levels.size (), ExcInternalError ());
+
+ // Backup the active_fe_indices vectors.
+ // The user might have put something
+ // important in them.
+ std::vector<std::vector<unsigned int> > active_fe_backup(levels.size ());
+ for (unsigned int i = 0; i < levels.size (); ++i)
+ std::swap (levels[i]->active_fe_indices, active_fe_backup[i]);
+
+ // delete all levels and set them up
+ // newly, since vectors are
+ // troublesome if you want to change
+ // their size
+ clear_space ();
+
+ vertex_dofs.resize(tria->vertices.size()*finite_elements->get_fe(0).dofs_per_vertex,
+ invalid_dof_index);
+
+//TODO[?] Does not work for continuous FEs. Problem is at faces, which might have a different
+// number of DoFs due to the different active_fe_index of the adjacent cells.
+ for (unsigned int i=0; i<tria->n_levels(); ++i)
+ {
+ levels.push_back (new hpDoFLevel<2>);
+ std::swap (active_fe_backup[i], levels.back()->active_fe_indices);
+
+ levels.back()->dof_line_index_offset = std::vector<unsigned int>
+ (tria->levels[i]->lines.lines.size (),static_cast<unsigned int>(-1));
+ levels.back()->dof_quad_index_offset = std::vector<unsigned int>
+ (tria->levels[i]->quads.quads.size (),static_cast<unsigned int>(-1));
+
+ // Create table of active_fe_levels of cells
+ // adjacent to the lines.
+ std::vector<unsigned int> line_active_fe_indices
+ (tria->levels[i]->lines.lines.size () * 2,
+ static_cast<unsigned int>(-1));
+
+ for (unsigned int j = 0; j < tria->levels[i]->quads.quads.size (); ++j)
+ {
+ const unsigned int cell_fe_index = levels.back ()->active_fe_indices[j];
+
+ // Referring to the following diagram from
+ // documentation of the triangulation class,
+ // it can be seen where the indices in the
+ // following lines of code come from.
+ // 2
+ // 3--->---2
+ // | |
+ // 3^ ^1
+ // | |
+ // 0--->---1
+ // 0
+ // Face 0 and 1 have the cell to the left,
+ // while Face 2 and 3 have the cell to
+ // the right (if the line points upward).
+ line_active_fe_indices[tria->levels[i]->
+ quads.quads[j].line(0) * 2] = cell_fe_index;
+ line_active_fe_indices[tria->levels[i]->
+ quads.quads[j].line(1) * 2] = cell_fe_index;
+ line_active_fe_indices[tria->levels[i]->
+ quads.quads[j].line(2) * 2 + 1] = cell_fe_index;
+ line_active_fe_indices[tria->levels[i]->
+ quads.quads[j].line(3) * 2 + 1] = cell_fe_index;
+ }
+
+ unsigned int dofs_for_lines = 0;
+ for (unsigned int j = 0; j < tria->levels[i]->lines.lines.size (); ++j)
+ {
+ levels.back()->dof_line_index_offset[j] = dofs_for_lines;
+
+ // The "line_dofs" field in the hpDoFLevel class for 2D gets a
+ // slightly different meaning in 2D. Actually in 2D one line can have
+ // two different active_fe_indices. Therefore it is not sufficient to
+ // reserve some space for the DoFs on one active_fe_index. Instead
+ // the DoF indices for both active_fe_indices will be stored in the
+ // "line_dofs" field. To differentiate between these field later,
+ // a simple linked list based will be maintained to allow access to
+ // the correct DoFs:
+ // 0: active_fe_index of line, to which the following DoFs belong.
+ // 1: index of next active_fe_index for this line. Value: (x + 1)
+ // 2-x: DoFs (will be filled out by distribute_dofs_on_cell
+ // x+1: active_fe_index of line, to which the following DoFs belong.
+ // x+2: index to next active_fe_index for this line. Value: (y + 1)
+ // ...
+ // In 3D, the same datastructure is used but can have up to 4 different
+ // active_fe_indices on one line.
+ unsigned int active_fe1 = line_active_fe_indices[j*2],
+ active_fe2 = line_active_fe_indices[j*2+1];
+
+ // Check for boundary lines, where clearly one of the line indices
+ // is missing.
+ if (active_fe1 == static_cast<unsigned int>(-1))
+ active_fe1 = active_fe2;
+ if (active_fe2 == static_cast<unsigned int>(-1))
+ active_fe2 = active_fe1;
+
+ if (active_fe1 == active_fe2)
+ dofs_for_lines += finite_elements->get_fe (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;
+ }
+
+ 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;
+ }
+
+ levels.back()->line_dofs = std::vector<unsigned int> (dofs_for_lines,
+ invalid_dof_index);
+ levels.back()->quad_dofs = std::vector<unsigned int> (dofs_for_quads,
+ invalid_dof_index);
+
+ // As we already have the active_fe_indices for the lines, it is probably
+ // a good idea to directly use those to create the linked list structure
+ // within the line_dofs field.
+ for (unsigned int j = 0; j < tria->levels[i]->lines.lines.size (); ++j)
+ {
+ dofs_for_lines = levels.back()->dof_line_index_offset[j];
+
+ levels.back()->dof_line_index_offset[j] = dofs_for_lines;
+ unsigned int active_fe1 = line_active_fe_indices[j*2],
+ active_fe2 = line_active_fe_indices[j*2+1];
+
+ // Check for boundary lines, where clearly one of the line indices
+ // is missing.
+ if (active_fe1 == static_cast<unsigned int>(-1))
+ active_fe1 = active_fe2;
+ if (active_fe2 == static_cast<unsigned int>(-1))
+ active_fe2 = active_fe1;
+
+ // Now create prepare linked list, with either 1 or two entries.
+ levels.back()->line_dofs[dofs_for_lines] = active_fe1;
+ if (active_fe1 == active_fe2)
+ levels.back()->line_dofs[dofs_for_lines + 1] =
+ static_cast<unsigned int>(-1);
+ else
+ {
+ unsigned int start_next_fe = dofs_for_lines +
+ finite_elements->get_fe (active_fe1).dofs_per_line + 2;
+
+ levels.back()->line_dofs[dofs_for_lines + 1] = start_next_fe;
+
+ levels.back()->line_dofs[start_next_fe] = active_fe2;
+ levels.back()->line_dofs[start_next_fe + 1] =
+ static_cast<unsigned int>(-1);
+ }
+ }
+ };
+}
+
+#endif
+
+
+#if deal_II_dimension == 3
+
+template <>
+void hpDoFHandler<3>::reserve_space ()
+{
+//TODO: This presently works only on the first FE of the FECollection. Fix this
+ Assert (finite_elements != 0, ExcNoFESelected());
+ Assert (tria->n_levels() > 0, ExcInvalidTriangulation());
+ Assert (tria->n_levels() == levels.size (), ExcInternalError ());
+
+ // Backup the active_fe_indices vectors.
+ // The user might have put something
+ // important in them.
+ std::vector<std::vector<unsigned int> > active_fe_backup(levels.size ());
+ for (unsigned int i = 0; i < levels.size (); ++i)
+ std::swap (levels[i]->active_fe_indices, active_fe_backup[i]);
+
+ // delete all levels and set them up
+ // newly, since vectors are
+ // troublesome if you want to change
+ // their size
+ clear_space ();
+
+ vertex_dofs.resize(tria->vertices.size()*finite_elements->get_fe(0).dofs_per_vertex,
+ invalid_dof_index);
+
+//TODO[?] Does not work for continuous FEs. Problem is at faces, which might have a different
+// number of DoFs due to the different active_fe_index of the adjacent cells.
+ for (unsigned int i=0; i<tria->n_levels(); ++i)
+ {
+ levels.push_back (new hpDoFLevel<3>);
+ std::swap (active_fe_backup[i], levels.back()->active_fe_indices);
+
+ levels.back()->dof_line_index_offset = std::vector<unsigned int>
+ (tria->levels[i]->lines.lines.size (),static_cast<unsigned int>(-1));
+ levels.back()->dof_quad_index_offset = std::vector<unsigned int>
+ (tria->levels[i]->quads.quads.size (),static_cast<unsigned int>(-1));
+ levels.back()->dof_hex_index_offset = std::vector<unsigned int>
+ (tria->levels[i]->hexes.hexes.size (),static_cast<unsigned int>(-1));
+
+ unsigned int dofs_for_lines = 0;
+/* Uncommented as we actually need some information about how many DoFs should be reserved
+ for the lines, which could have different active_fe_indices. For DG there should be no
+ DoFs on lines or quads anyway.
+ 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;
+ }
+*/
+ 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;
+ }
+*/
+ unsigned int dofs_for_hexes = 0;
+ 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;
+ }
+
+ levels.back()->line_dofs = std::vector<unsigned int> (dofs_for_lines,
+ invalid_dof_index);
+ levels.back()->quad_dofs = std::vector<unsigned int> (dofs_for_quads,
+ invalid_dof_index);
+ levels.back()->hex_dofs = std::vector<unsigned int> (dofs_for_hexes,
+ invalid_dof_index);
+ };
+}
+
+#endif
+
+
+//
+// Method to create a standard table for the active_fe vector.
+// It is called before the Triangulation is refined and before
+// distribute_dofs is called. That are probably the two places,
+// where an incorrect active_fe table can cause some trouble.
+//
+
+template <int dim>
+void hpDoFHandler<dim>::create_active_fe_table ()
+{
+ // Create sufficiently many hpDoFLevels.
+ while (levels.size () < tria->n_levels ())
+ levels.push_back (new hpDoFLevel<dim>);
+
+ for (unsigned int i=0; i<levels.size(); ++i)
+ {
+ if (levels[i]->active_fe_indices.size () == 0)
+ {
+ // The size of "refine_flags" serves as
+ // the number of cells available on that
+ // level. The alternative would be to
+ // implement this method for each dimension.
+ levels[i]->active_fe_indices.reserve (tria->levels[i]->refine_flags.size ());
+ std::fill (levels[i]->active_fe_indices.begin (),
+ levels[i]->active_fe_indices.end (),
+ 0);
+ }
+ else
+ {
+ // Either the active_fe_indices have size
+ // zero, or the correct size. Other sizes
+ // indicate that something went wrong.
+ Assert (levels[i]->active_fe_indices.size () ==
+ tria->levels[i]->refine_flags.size (), ExcInternalError ());
+ }
+ }
+}
+
+
+template <int dim>
+void hpDoFHandler<dim>::pre_refinement_notification (const Triangulation<dim> &)
+{
+ create_active_fe_table ();
+}
+
+
+#if deal_II_dimension == 1
+template <>
+void hpDoFHandler<1>::pre_refinement_notification (const Triangulation<1> &tria)
+{
+ create_active_fe_table ();
+
+ // Remember if the cells have already
+ // children. That will make the transfer
+ // of the active_fe_index to the finer
+ // levels easier.
+ Assert (has_children.size () == 0, ExcInternalError ());
+ for (unsigned int i=0; i<levels.size(); ++i)
+ {
+ const unsigned int lines_on_level = tria.levels[i]->lines.lines.size ();
+ std::vector<bool> *has_children_level =
+ new std::vector<bool> (lines_on_level);
+
+ // Check for each cell, if it has children.
+ transform (tria.levels[i]->lines.children.begin (),
+ tria.levels[i]->lines.children.end (),
+ has_children_level->begin (),
+ std::bind2nd (std::not_equal_to<int>(), -1));
+
+ has_children.push_back (has_children_level);
+ }
+}
+#endif
+
+#if deal_II_dimension == 2
+template <>
+void hpDoFHandler<2>::pre_refinement_notification (const Triangulation<2> &tria)
+{
+ create_active_fe_table ();
+
+ // Remember if the cells have already
+ // children. That will make the transfer
+ // of the active_fe_index to the finer
+ // levels easier.
+ Assert (has_children.size () == 0, ExcInternalError ());
+ for (unsigned int i=0; i<levels.size(); ++i)
+ {
+ const unsigned int quads_on_level = tria.levels[i]->quads.quads.size ();
+ std::vector<bool> *has_children_level =
+ new std::vector<bool> (quads_on_level);
+
+ // Check for each cell, if it has children.
+ transform (tria.levels[i]->quads.children.begin (),
+ tria.levels[i]->quads.children.end (),
+ has_children_level->begin (),
+ std::bind2nd (std::not_equal_to<int>(), -1));
+
+ has_children.push_back (has_children_level);
+ }
+}
+#endif
+
+#if deal_II_dimension == 3
+template <>
+void hpDoFHandler<3>::pre_refinement_notification (const Triangulation<3> &tria)
+{
+ create_active_fe_table ();
+
+ // Remember if the cells have already
+ // children. That will make the transfer
+ // of the active_fe_index to the finer
+ // levels easier.
+ Assert (has_children.size () == 0, ExcInternalError ());
+ for (unsigned int i=0; i<levels.size(); ++i)
+ {
+ const unsigned int hexes_on_level = tria.levels[i]->hexes.hexes.size ();
+ std::vector<bool> *has_children_level =
+ new std::vector<bool> (hexes_on_level);
+
+ // Check for each cell, if it has children.
+ transform (tria.levels[i]->hexes.children.begin (),
+ tria.levels[i]->hexes.children.end (),
+ has_children_level->begin (),
+ std::bind2nd (std::not_equal_to<int>(), -1));
+
+ has_children.push_back (has_children_level);
+ }
+}
+#endif
+
+template <int dim>
+void hpDoFHandler<dim>::post_refinement_notification (const Triangulation<dim> &tria)
+{
+ Assert (has_children.size () == levels.size (), ExcInternalError ());
+
+ // In each refinement at most one new
+ // new level may appear. If that happened
+ // it is appended to the hpDoFHandler
+ // levels.
+ if (levels.size () < tria.n_levels ())
+ levels.push_back (new hpDoFLevel<dim>);
+
+ // Coarsening can lead to the loss
+ // of levels. Hence remove them.
+ while (levels.size () > tria.n_levels ())
+ {
+ delete levels[levels.size ()-1];
+ levels.pop_back ();
+ }
+
+ // Resize active_fe_indices vectors
+ for (unsigned int i=0; i<levels.size(); ++i)
+ levels[i]->active_fe_indices.resize (tria.levels[i]->refine_flags.size ());
+
+ cell_iterator cell = begin(),
+ endc = end ();
+ for (; cell != endc; ++cell)
+ {
+ // Look if the cell got children during
+ // refinement
+ // Note: Although one level is added to
+ // the hpDoFHandler levels, when the
+ // triangulation got one, for the buffer
+ // has_children this new level is not
+ // required, because the cells on the
+ // finest level never have children. Hence
+ // cell->has_children () will always return
+ // false on that level, which would cause
+ // shortcut evaluation of the following
+ // expression. Thus an index error in
+ // has_children should never occur.
+ if (cell->has_children () &&
+ !(*has_children [cell->level ()])[cell->index ()])
+ {
+ // Set active_fe_index in children to the
+ // same value as in the parent cell.
+ for (unsigned int i = 0; i < GeometryInfo<dim>::children_per_cell; ++i)
+ cell->child (i)->set_active_fe_index (cell->active_fe_index ());
+ }
+ }
+
+ // Free buffer objects
+ std::vector<std::vector<bool> *>::iterator children_level;
+ for (children_level = has_children.begin ();
+ children_level != has_children.end ();
+ ++children_level)
+ delete (*children_level);
+ /*
+ for_each (has_children.begin (),
+ has_children.end (),
+ delete());
+ */
+ has_children.clear ();
+}
+
+
+template <int dim>
+void hpDoFHandler<dim>::clear_space () {
+ for (unsigned int i=0; i<levels.size(); ++i)
+ delete levels[i];
+ levels.resize (0);
+
+ std::vector<unsigned int> tmp;
+ std::swap (vertex_dofs, tmp);
+}
+
+
+/*-------------- Explicit Instantiations -------------------------------*/
+template class hpDoFHandler<deal_II_dimension>;
--- /dev/null
+//---------------------------- hp_dof_levels.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2003 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- hp_dof_levels.cc ------------------------
+
+
+#include <base/memory_consumption.h>
+#include <dofs/hp_dof_levels.h>
+
+
+unsigned int
+hpDoFLevel<1>::memory_consumption () const
+{
+ return (MemoryConsumption::memory_consumption (line_dofs) +
+ MemoryConsumption::memory_consumption (dof_line_index_offset));
+}
+
+
+
+unsigned int
+hpDoFLevel<2>::memory_consumption () const
+{
+ return (hpDoFLevel<1>::memory_consumption () +
+ MemoryConsumption::memory_consumption (quad_dofs) +
+ MemoryConsumption::memory_consumption (dof_quad_index_offset));
+}
+
+
+
+unsigned int
+hpDoFLevel<3>::memory_consumption () const
+{
+ return (hpDoFLevel<2>::memory_consumption () +
+ MemoryConsumption::memory_consumption (hex_dofs) +
+ MemoryConsumption::memory_consumption (dof_hex_index_offset));
+}
--- /dev/null
+//---------------------------- fe_collection.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2003, 2004 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- fe_collection.cc ---------------------------
+
+#include <base/memory_consumption.h>
+#include <fe/fe_collection.h>
+
+
+template <int dim>
+FECollection<dim>::~FECollection ()
+{
+ for (unsigned int i=0; i<finite_elements.size(); ++i)
+ {
+ const FiniteElement<dim> *p = finite_elements[i];
+ finite_elements[i] = 0;
+ delete p;
+ }
+
+ finite_elements.clear ();
+}
+
+
+
+template <int dim>
+unsigned int FECollection<dim>::add_fe (const FiniteElement<dim> &new_fe)
+{
+ // check that the new element has the right
+ // number of components. only check with
+ // the first element, since all the other
+ // elements have already passed the test
+ // against the first element
+ if (finite_elements.size() != 0)
+ Assert (new_fe.n_components() == finite_elements[0]->n_components(),
+ ExcMessage ("All elements inside a collection need to have the "
+ "same number of vector components!"));
+
+ finite_elements.push_back (new_fe.clone());
+ return (finite_elements.size ());
+}
+
+
+
+template <int dim>
+unsigned int
+FECollection<dim>::memory_consumption () const
+{
+ unsigned int mem
+ = (sizeof(*this) +
+ MemoryConsumption::memory_consumption (finite_elements));
+ for (unsigned int i=0; i<finite_elements.size(); ++i)
+ mem += finite_elements[i]->memory_consumption();
+
+ return mem;
+}
+
+
+// explicit instantiations
+template class FECollection<deal_II_dimension>;
template <int dim,
+ template <int> class DH1,
+ template <int> class DH2,
class InVector, class OutVector>
void
-FETools::interpolate(const DoFHandler<dim> &dof1,
- const InVector &u1,
- const DoFHandler<dim> &dof2,
- OutVector &u2)
+FETools::interpolate(const DH1<dim> &dof1,
+ const InVector &u1,
+ const DH2<dim> &dof2,
+ OutVector &u2)
{
ConstraintMatrix dummy;
dummy.close();
+template <int dim,
+ template <int> class DH1,
+ template <int> class DH2,
+ class InVector, class OutVector>
+void
+FETools::interpolate (const DH1<dim> &dof1,
+ const InVector &u1,
+ const DH2<dim> &dof2,
+ const ConstraintMatrix &constraints,
+ OutVector &u2)
+{
+ Assert(&dof1.get_tria()==&dof2.get_tria(), ExcTriangulationMismatch());
+
+ Assert(u1.size()==dof1.n_dofs(),
+ ExcDimensionMismatch(u1.size(), dof1.n_dofs()));
+ Assert(u2.size()==dof2.n_dofs(),
+ ExcDimensionMismatch(u2.size(), dof2.n_dofs()));
+
+ // allocate vectors at maximal
+ // size. will be reinited in inner
+ // cell, but Vector makes sure that
+ // this does not lead to
+ // reallocation of memory
+ Vector<typename OutVector::value_type> u1_local(max_dofs_per_cell(dof1));
+ Vector<typename OutVector::value_type> u2_local(max_dofs_per_cell(dof2));
+
+ // have a map for interpolation
+ // matrices. shared_ptr make sure
+ // that memory is released again
+ std::map<const FiniteElement<dim> *,
+ std::map<const FiniteElement<dim> *,
+ boost::shared_ptr<FullMatrix<double> > > >
+ interpolation_matrices;
+
+ typename DH1<dim>::active_cell_iterator cell1 = dof1.begin_active(),
+ endc1 = dof1.end();
+ typename DH2<dim>::active_cell_iterator cell2 = dof2.begin_active(),
+ endc2 = dof2.end();
+
+ std::vector<unsigned int> touch_count(dof2.n_dofs(),0);
+ std::vector<unsigned int> dofs;
+ dofs.reserve (max_dofs_per_cell (dof2));
+ u2.clear ();
+
+ for (; cell1!=endc1; ++cell1, ++cell2)
+ {
+ Assert(cell1->get_fe().n_components() == cell2->get_fe().n_components(),
+ ExcDimensionMismatch (cell1->get_fe().n_components(),
+ cell2->get_fe().n_components()));
+
+ // for continuous elements on
+ // grids with hanging nodes we
+ // need hanging node
+ // constraints. Consequentely,
+ // if there are no constraints
+ // then hanging nodes are not
+ // allowed.
+ const bool hanging_nodes_not_allowed
+ = ((cell2->get_fe().dofs_per_vertex != 0) &&
+ (constraints.n_constraints() == 0));
+
+ if (hanging_nodes_not_allowed)
+ for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
+ Assert (cell1->at_boundary(face) ||
+ cell1->neighbor(face)->level() == cell1->level(),
+ ExcHangingNodesNotAllowed(0));
+
+
+ const unsigned int dofs_per_cell1 = cell1->get_fe().dofs_per_cell;
+ const unsigned int dofs_per_cell2 = cell2->get_fe().dofs_per_cell;
+ u1_local.reinit (dofs_per_cell1);
+ u2_local.reinit (dofs_per_cell2);
+
+ // check if interpolation
+ // matrix for this particular
+ // pair of elements is already
+ // there
+ if (interpolation_matrices[&cell1->get_fe()][&cell2->get_fe()] == 0)
+ {
+ boost::shared_ptr<FullMatrix<double> >
+ interpolation_matrix (new FullMatrix<double> (dofs_per_cell2,
+ dofs_per_cell1));
+ interpolation_matrices[&cell1->get_fe()][&cell2->get_fe()]
+ = interpolation_matrix;
+
+ FETools::get_interpolation_matrix(cell1->get_fe(),
+ cell2->get_fe(),
+ *interpolation_matrix);
+ }
+
+ cell1->get_dof_values(u1, u1_local);
+ interpolation_matrices[&cell1->get_fe()][&cell2->get_fe()]
+ ->vmult(u2_local, u1_local);
+
+ dofs.resize (dofs_per_cell2);
+ cell2->get_dof_indices(dofs);
+
+ for (unsigned int i=0; i<dofs_per_cell2; ++i)
+ {
+ u2(dofs[i])+=u2_local(i);
+ ++touch_count[dofs[i]];
+ }
+ }
+ // cell1 is at the end, so should
+ // be cell2
+ Assert (cell2 == endc2, ExcInternalError());
+
+ // when a discontinuous element is
+ // interpolated to a continuous
+ // one, we take the mean values.
+ for (unsigned int i=0; i<dof2.n_dofs(); ++i)
+ {
+ Assert(touch_count[i]!=0, ExcInternalError());
+ u2(i) /= touch_count[i];
+ }
+
+ // Apply hanging node constraints.
+ constraints.distribute(u2);
+}
+
+
+
template <int dim, class InVector, class OutVector>
void
FETools::back_interpolate(const DoFHandler<dim> &dof1,
+template <int dim,
+ template <int> class DH,
+ class InVector, class OutVector>
+void
+FETools::back_interpolate(const DH<dim> &dof1,
+ const InVector &u1,
+ const FiniteElement<dim> &fe2,
+ OutVector &u1_interpolated)
+{
+ Assert(u1.size() == dof1.n_dofs(),
+ ExcDimensionMismatch(u1.size(), dof1.n_dofs()));
+ Assert(u1_interpolated.size() == dof1.n_dofs(),
+ ExcDimensionMismatch(u1_interpolated.size(), dof1.n_dofs()));
+
+ Vector<typename OutVector::value_type> u1_local(max_dofs_per_cell(dof1));
+ Vector<typename OutVector::value_type> u1_int_local(max_dofs_per_cell(dof1));
+
+ typename DH<dim>::active_cell_iterator cell = dof1.begin_active(),
+ endc = dof1.end();
+
+ // map from possible fe objects in
+ // dof1 to the back_interpolation
+ // matrices
+ std::map<const FiniteElement<dim> *,
+ boost::shared_ptr<FullMatrix<double> > > interpolation_matrices;
+
+ for (; cell!=endc; ++cell)
+ {
+ Assert(cell->get_fe().n_components() == fe2.n_components(),
+ ExcDimensionMismatch(cell->get_fe().n_components(),
+ fe2.n_components()));
+
+ // For continuous elements on
+ // grids with hanging nodes we
+ // need hanging node
+ // constraints. Consequently,
+ // when the elements are
+ // continuous no hanging node
+ // constraints are allowed.
+ const bool hanging_nodes_not_allowed=
+ (cell->get_fe().dofs_per_vertex != 0) || (fe2.dofs_per_vertex != 0);
+
+ if (hanging_nodes_not_allowed)
+ for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
+ Assert (cell->at_boundary(face) ||
+ cell->neighbor(face)->level() == cell->level(),
+ ExcHangingNodesNotAllowed(0));
+
+ const unsigned int dofs_per_cell1 = cell->get_fe().dofs_per_cell;
+
+ // make sure back_interpolation
+ // matrix is available
+ if (interpolation_matrices[&cell->get_fe()] != 0)
+ {
+ interpolation_matrices[&cell->get_fe()] =
+ boost::shared_ptr<FullMatrix<double> >
+ (new FullMatrix<double>(dofs_per_cell1, dofs_per_cell1));
+ get_back_interpolation_matrix(dof1.get_fe(), fe2,
+ *interpolation_matrices[&cell->get_fe()]);
+ }
+
+ u1_local.reinit (dofs_per_cell1);
+ u1_int_local.reinit (dofs_per_cell1);
+
+ cell->get_dof_values(u1, u1_local);
+ interpolation_matrices[&cell->get_fe()]->vmult(u1_int_local, u1_local);
+ cell->set_dof_values(u1_int_local, u1_interpolated);
+ }
+}
+
+
+
template <int dim, class InVector, class OutVector>
void FETools::back_interpolate(const DoFHandler<dim> &dof1,
const ConstraintMatrix &constraints1,
+template <int dim>
+void
+FEValues<dim>::reinit (const typename hpDoFHandler<dim>::cell_iterator &cell)
+{
+ // assert that the finite elements
+ // passed to the constructor and
+ // 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_fe()),
+ typename FEValuesBase<dim>::ExcFEDontMatch());
+
+ // set new cell. auto_ptr will take
+ // care that old object gets
+ // destroyed and also that this
+ // object gets destroyed in the
+ // destruction of this class
+ this->present_cell.reset
+ (new typename FEValuesBase<dim>::template
+ CellIterator<typename hpDoFHandler<dim>::cell_iterator> (cell));
+
+ // this was the part of the work
+ // that is dependent on the actual
+ // data type of the iterator. now
+ // pass on to the function doing
+ // the real work.
+ do_reinit ();
+}
+
+
+
template <int dim>
void
FEValues<dim>::reinit (const typename MGDoFHandler<dim>::cell_iterator &cell)
}
+
+//TODO:[?] Change for real hpDoFHandler
+// Probably the first assertion has to be changed, when the real hpDoFHandler
+// is available.
+template <int dim>
+void FEFaceValues<dim>::reinit (const typename hpDoFHandler<dim>::cell_iterator &cell,
+ const unsigned int face_no)
+{
+ // assert that the finite elements
+ // passed to the constructor and
+ // 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 ())),
+ typename FEValuesBase<dim>::ExcFEDontMatch());
+
+ Assert (face_no < GeometryInfo<dim>::faces_per_cell,
+ ExcIndexRange (face_no, 0, GeometryInfo<dim>::faces_per_cell));
+
+ // set new cell. auto_ptr will take
+ // care that old object gets
+ // destroyed and also that this
+ // object gets destroyed in the
+ // destruction of this class
+ this->present_cell.reset
+ (new typename FEValuesBase<dim>::template
+ CellIterator<typename hpDoFHandler<dim>::cell_iterator> (cell));
+
+ // this was the part of the work
+ // that is dependent on the actual
+ // data type of the iterator. now
+ // pass on to the function doing
+ // the real work.
+ do_reinit (face_no);
+}
+
+
template <int dim>
void FEFaceValues<dim>::reinit (const typename MGDoFHandler<dim>::cell_iterator &cell,
const unsigned int face_no)
}
-
template <int dim>
void FEFaceValues<dim>::reinit (const typename Triangulation<dim>::cell_iterator &cell,
const unsigned int face_no)
}
-
+//TODO:[?] Change for real hpDoFHandler
+// Probably the first assertion has to be changed, when the real hpDoFHandler
+// is available.
template <int dim>
-void FESubfaceValues<dim>::reinit (const typename MGDoFHandler<dim>::cell_iterator &cell,
+void FESubfaceValues<dim>::reinit (const typename hpDoFHandler<dim>::cell_iterator &cell,
const unsigned int face_no,
const unsigned int subface_no)
{
// assert that the finite elements
// passed to the constructor and
- // used by the DoFHandler used by
+ // used by the hpDoFHandler 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()),
+ static_cast<const FiniteElementData<dim>&>(cell->get_dof_handler().get_fe().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));
ExcMessage ("You can't use subface data for cells that are "
"already refined. Iterate over their children "
"instead in these cases."));
+
+ // set new cell. auto_ptr will take
+ // care that old object gets
+ // destroyed and also that this
+ // object gets destroyed in the
+ // destruction of this class
+ this->present_cell.reset
+ (new typename FEValuesBase<dim>::template
+ CellIterator<typename hpDoFHandler<dim>::cell_iterator> (cell));
+
+ // this was the part of the work
+ // that is dependent on the actual
+ // data type of the iterator. now
+ // pass on to the function doing
+ // the real work.
+ do_reinit (face_no, subface_no);
+}
+
+template <int dim>
+void FESubfaceValues<dim>::reinit (const typename MGDoFHandler<dim>::cell_iterator &cell,
+ const unsigned int face_no,
+ const unsigned int subface_no)
+{
+ Assert (static_cast<const FiniteElementData<dim>&>(*this->fe) ==
+ static_cast<const FiniteElementData<dim>&>(cell->get_dof_handler().get_fe()),
+ typename FEValuesBase<dim>::ExcFEDontMatch());
+ Assert (face_no < GeometryInfo<dim>::faces_per_cell,
+ ExcIndexRange (face_no, 0, GeometryInfo<dim>::faces_per_cell));
+ Assert (subface_no < GeometryInfo<dim>::subfaces_per_face,
+ ExcIndexRange (subface_no, 0, GeometryInfo<dim>::subfaces_per_face));
+ Assert (cell->has_children() == false,
+ ExcMessage ("You can't use subface data for cells that are "
+ "already refined. Iterate over their children "
+ "instead in these cases."));
+
// set new cell. auto_ptr will take
// care that old object gets
// destroyed and also that this
--- /dev/null
+//---------------------------- hp_fe_values.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2003 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- hp_fe_values.cc ---------------------------
+
+
+#include <fe/hp_fe_values.h>
+#include <fe/mapping_q1.h>
+
+
+// -------------------------- FEValuesMap -------------------------
+
+namespace internal
+{
+ template <int dim, class FEValues>
+ FEValuesMap<dim,FEValues>::~FEValuesMap ()
+ {}
+
+
+ template <int dim, class FEValues>
+ FEValues &
+ FEValuesMap<dim,FEValues>::select_fe_values (const FiniteElement<dim> &fe)
+ {
+ // check if the finite element
+ // does not exist as a key in the
+ // map
+ if (fe_to_fe_values_map.find (&fe) ==
+ fe_to_fe_values_map.end())
+ // a-ha! doesn't yet, so let's
+ // make it up
+ fe_to_fe_values_map[&fe]
+ = boost::shared_ptr<FEValues> (create_fe_values (fe));
+
+
+ // now there definitely is one!
+ present_fe_values = fe_to_fe_values_map[&fe];
+
+ return *present_fe_values;
+ }
+
+
+// -------------------------- hpFEValuesBase -------------------------
+
+ template <int dim, int q_dim>
+ const MappingQ1<dim>
+ hpFEValuesBase<dim,q_dim>::default_mapping;
+
+
+
+ template <int dim, int q_dim>
+ hpFEValuesBase<dim,q_dim>::hpFEValuesBase (
+ const MappingCollection<dim> &mapping_collection,
+ const QCollection<q_dim> &qcollection,
+ const UpdateFlags update_flags)
+ :
+ mapping_collection (mapping_collection),
+ qcollection (qcollection),
+ update_flags (update_flags)
+ {}
+
+
+ template <int dim, int q_dim>
+ hpFEValuesBase<dim,q_dim>::hpFEValuesBase (const QCollection<q_dim> &qcollection,
+ const UpdateFlags update_flags)
+ :
+ mapping_collection (default_mapping),
+ qcollection (qcollection),
+ update_flags (update_flags)
+ {}
+
+}
+
+
+// -------------------------- hpFEValues -------------------------
+
+
+template <int dim>
+hpFEValues<dim>::hpFEValues (const MappingCollection<dim> &mapping,
+ const FECollection<dim> &/*fe_collection*/,
+ const QCollection<dim> &qcollection,
+ const UpdateFlags update_flags)
+ :
+ internal::hpFEValuesBase<dim,dim> (mapping,
+ qcollection,
+ update_flags)
+{}
+
+
+template <int dim>
+hpFEValues<dim>::hpFEValues (const FECollection<dim> &/*fe_collection*/,
+ const QCollection<dim> &qcollection,
+ const UpdateFlags update_flags)
+ :
+ internal::hpFEValuesBase<dim,dim> (qcollection,
+ update_flags)
+{}
+
+
+template <int dim>
+void
+hpFEValues<dim>::reinit (const typename hpDoFHandler<dim>::cell_iterator &cell)
+{
+ this->present_fe_index = cell->active_fe_index ();
+ this->select_fe_values (cell->get_fe()).reinit (cell);
+}
+
+
+
+template <int dim>
+FEValues<dim> *
+hpFEValues<dim>::create_fe_values (const FiniteElement<dim> &fe) const
+{
+ return new FEValues<dim> (
+ this->mapping_collection.get_mapping (this->present_fe_index), fe,
+ this->qcollection.get_quadrature (this->present_fe_index),
+ this->update_flags);
+}
+
+
+// -------------------------- hpFEFaceValues -------------------------
+
+
+template <int dim>
+hpFEFaceValues<dim>::hpFEFaceValues (const MappingCollection<dim> &mapping,
+ const FECollection<dim> &/*fe_collection*/,
+ const QCollection<dim-1> &qcollection,
+ const UpdateFlags update_flags)
+ :
+ internal::hpFEValuesBase<dim,dim-1> (mapping,
+ qcollection,
+ update_flags)
+{}
+
+
+template <int dim>
+hpFEFaceValues<dim>::hpFEFaceValues (const FECollection<dim> &/*fe_collection*/,
+ const QCollection<dim-1> &qcollection,
+ const UpdateFlags update_flags)
+ :
+ internal::hpFEValuesBase<dim,dim-1> (qcollection,
+ update_flags)
+{}
+
+
+template <int dim>
+void
+hpFEFaceValues<dim>::reinit (const typename hpDoFHandler<dim>::cell_iterator &cell,
+ const unsigned int face_no)
+{
+ this->present_fe_index = cell->active_fe_index ();
+ this->select_fe_values (cell->get_fe()).reinit (cell, face_no);
+}
+
+
+
+template <int dim>
+FEFaceValues<dim> *
+hpFEFaceValues<dim>::create_fe_values (const FiniteElement<dim> &fe) const
+{
+ return new FEFaceValues<dim> (
+ this->mapping_collection.get_mapping (this->present_fe_index), fe,
+ this->qcollection.get_quadrature (this->present_fe_index),
+ this->update_flags);
+}
+
+
+// -------------------------- hpFESubfaceValues -------------------------
+
+
+template <int dim>
+hpFESubfaceValues<dim>::hpFESubfaceValues (const MappingCollection<dim> &mapping,
+ const FECollection<dim> &/*fe_collection*/,
+ const QCollection<dim-1> &qcollection,
+ const UpdateFlags update_flags)
+ :
+ internal::hpFEValuesBase<dim,dim-1> (mapping,
+ qcollection,
+ update_flags)
+{}
+
+
+template <int dim>
+hpFESubfaceValues<dim>::hpFESubfaceValues (const FECollection<dim> &/*fe_collection*/,
+ const QCollection<dim-1> &qcollection,
+ const UpdateFlags update_flags)
+ :
+ internal::hpFEValuesBase<dim,dim-1> (qcollection,
+ update_flags)
+{}
+
+
+template <int dim>
+void
+hpFESubfaceValues<dim>::reinit (const typename hpDoFHandler<dim>::cell_iterator &cell,
+ const unsigned int face_no,
+ const unsigned int subface_no)
+{
+ this->present_fe_index = cell->active_fe_index ();
+ this->select_fe_values (cell->get_fe()).reinit (cell, face_no, subface_no);
+}
+
+
+
+template <int dim>
+FESubfaceValues<dim> *
+hpFESubfaceValues<dim>::create_fe_values (const FiniteElement<dim> &fe) const
+{
+ return new FESubfaceValues<dim> (
+ this->mapping_collection.get_mapping (this->present_fe_index), fe,
+ this->qcollection.get_quadrature (this->present_fe_index),
+ this->update_flags);
+}
+
+
+
+
+// explicit instantiations
+namespace internal
+{
+ template class FEValuesMap<deal_II_dimension,FEValues<deal_II_dimension> >;
+ template class FEValuesMap<deal_II_dimension,FEFaceValues<deal_II_dimension> >;
+ template class FEValuesMap<deal_II_dimension,FESubfaceValues<deal_II_dimension> >;
+
+ template class hpFEValuesBase<deal_II_dimension,deal_II_dimension>;
+#if deal_II_dimension >= 2
+ template class hpFEValuesBase<deal_II_dimension,deal_II_dimension-1>;
+#endif
+}
+
+template class hpFEValues<deal_II_dimension>;
+#if deal_II_dimension >= 2
+template class hpFEFaceValues<deal_II_dimension>;
+template class hpFESubfaceValues<deal_II_dimension>;
+#endif
+
--- /dev/null
+//----------------------- mapping_collection.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2003 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//----------------------- mapping_collection.cc ---------------------------
+
+#include <base/memory_consumption.h>
+#include <fe/mapping_collection.h>
+
+
+template <int dim>
+MappingCollection<dim>::MappingCollection () :
+ single_mapping (false)
+{
+}
+
+
+template <int dim>
+MappingCollection<dim>::MappingCollection (const Mapping<dim> &mapping) :
+ single_mapping (true)
+{
+ mappings.push_back (&mapping);
+}
+
+
+template <int dim>
+inline
+const Mapping<dim> &
+MappingCollection<dim>::get_mapping (const unsigned int active_fe_index) const
+{
+ SmartPointer<const Mapping<dim> > mapping;
+
+ if (single_mapping)
+ mapping = mappings[0];
+ else
+ {
+ Assert (active_fe_index < mappings.size (),
+ ExcIndexRange (active_fe_index, 0, mappings.size ()));
+ mapping = mappings[active_fe_index];
+ }
+
+ return *mapping;
+}
+
+
+template <int dim>
+unsigned int
+MappingCollection<dim>::memory_consumption () const
+{
+ return (sizeof(*this) +
+ MemoryConsumption::memory_consumption (mappings));
+}
+
+
+template <int dim>
+unsigned int MappingCollection<dim>::
+add_mapping (const Mapping<dim> &new_mapping)
+{
+ // A MappingCollection, which was initialized as single
+ // MappingCollection cannot administrate other Mappings.
+ Assert (!single_mapping,
+ ExcNotInitialized ());
+ mappings.push_back (&new_mapping);
+ return (mappings.size ());
+}
+
+
+// explicit instantiations
+template class MappingCollection<deal_II_dimension>;
--- /dev/null
+//---------------------------- q_collection.cc ----------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2003 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- q_collection.cc ----------------------------
+
+#include <base/memory_consumption.h>
+#include <fe/q_collection.h>
+
+
+template <int dim>
+QCollection<dim>::QCollection () :
+ single_quadrature (false)
+{
+}
+
+
+template <int dim>
+QCollection<dim>::QCollection (const Quadrature<dim> &quadrature) :
+ single_quadrature (true)
+{
+ quadratures.push_back (&quadrature);
+}
+
+
+template <int dim>
+inline
+const Quadrature<dim> &
+QCollection<dim>::get_quadrature (const unsigned int active_fe_index) const
+{
+ SmartPointer<const Quadrature<dim> > quad;
+
+ if (single_quadrature)
+ quad = quadratures[0];
+ else
+ {
+ Assert (active_fe_index < quadratures.size (),
+ ExcIndexRange (active_fe_index, 0, quadratures.size ()));
+ quad = quadratures[active_fe_index];
+ }
+
+ return *quad;
+}
+
+
+template <int dim>
+unsigned int
+QCollection<dim>::memory_consumption () const
+{
+ return (sizeof(*this) +
+ MemoryConsumption::memory_consumption (quadratures));
+}
+
+
+template <int dim>
+unsigned int QCollection<dim>::
+add_quadrature (const Quadrature<dim> &new_quadrature)
+{
+ // A QCollection, which was initialized as single QCollection cannot
+ // administrate other Quadratures.
+ Assert (!single_quadrature,
+ ExcNotInitialized ());
+ quadratures.push_back (&new_quadrature);
+ return (quadratures.size ());
+}
+
+
+// explicit instantiations
+template class QCollection<deal_II_dimension>;
+#if deal_II_dimension >= 2
+template class QCollection<deal_II_dimension-1>;
+#endif
template <int dim>
unsigned int MGDoFObjectAccessor<1, dim>::mg_dof_index (const unsigned int i) const
{
+ typedef DoFAccessor<dim, DoFHandler> BaseClass;
+
Assert (this->dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (this->mg_dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
// make sure a FE has been selected
// and enough room was reserved
Assert (&this->dof_handler->get_fe() != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (i<this->dof_handler->get_fe().dofs_per_line,
ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_line));
void MGDoFObjectAccessor<1, dim>::set_mg_dof_index (const unsigned int i,
const unsigned int index) const
{
+ typedef DoFAccessor<dim, DoFHandler> BaseClass;
+
Assert (this->dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (this->mg_dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
// make sure a FE has been selected
// and enough room was reserved
Assert (&this->dof_handler->get_fe() != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (i<this->dof_handler->get_fe().dofs_per_line,
ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_line));
unsigned int MGDoFObjectAccessor<1, dim>::mg_vertex_dof_index (const unsigned int vertex,
const unsigned int i) const
{
+ typedef DoFAccessor<dim, DoFHandler> BaseClass;
+
Assert (this->dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (this->mg_dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (&this->dof_handler->get_fe() != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (vertex<2, ExcIndexRange (i,0,2));
Assert (i<this->dof_handler->get_fe().dofs_per_vertex,
ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_vertex));
const unsigned int i,
const unsigned int index) const
{
+ typedef DoFAccessor<dim, DoFHandler> BaseClass;
+
Assert (this->dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (this->mg_dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (&this->dof_handler->get_fe() != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (vertex<2, ExcIndexRange (i,0,2));
Assert (i<this->dof_handler->get_fe().dofs_per_vertex,
ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_vertex));
void
MGDoFObjectAccessor<1, dim>::get_mg_dof_indices (std::vector<unsigned int> &dof_indices) const
{
+ typedef DoFAccessor<dim, DoFHandler> BaseClass;
+
Assert (this->dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (this->mg_dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (&this->dof_handler->get_fe() != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (dof_indices.size() == (2*this->dof_handler->get_fe().dofs_per_vertex +
this->dof_handler->get_fe().dofs_per_line),
- typename DoFAccessor<dim>::ExcVectorDoesNotMatch());
+ typename BaseClass::ExcVectorDoesNotMatch());
const unsigned int dofs_per_vertex = this->dof_handler->get_fe().dofs_per_vertex,
dofs_per_line = this->dof_handler->get_fe().dofs_per_line;
MGDoFObjectAccessor<1,dim>::get_mg_dof_values (const Vector<number> &values,
Vector<number> &dof_values) const
{
- Assert (this->dof_handler != 0, DoFAccessor<1>::ExcInvalidObject());
- Assert (this->mg_dof_handler != 0, DoFAccessor<1>::ExcInvalidObject());
- Assert (&this->dof_handler->get_fe() != 0, DoFAccessor<1>::ExcInvalidObject());
+ typedef DoFAccessor<1, DoFHandler> BaseClass;
+
+ Assert (this->dof_handler != 0,
+ typename BaseClass::ExcInvalidObject());
+ Assert (this->mg_dof_handler != 0,
+ typename BaseClass::ExcInvalidObject());
+ Assert (&this->dof_handler->get_fe() != 0,
+ typename BaseClass::ExcInvalidObject());
Assert (dof_values.size() == this->dof_handler->get_fe().dofs_per_cell,
- DoFAccessor<1>::ExcVectorDoesNotMatch());
+ typename BaseClass::ExcVectorDoesNotMatch());
Assert (values.size() == this->dof_handler->n_dofs(),
- DoFAccessor<1>::ExcVectorDoesNotMatch());
+ typename BaseClass::ExcVectorDoesNotMatch());
const unsigned int dofs_per_vertex = this->dof_handler->get_fe().dofs_per_vertex,
dofs_per_line = this->dof_handler->get_fe().dofs_per_line;
void
MGDoFObjectAccessor<1, dim>::copy_from (const MGDoFObjectAccessor<1, dim> &a)
{
- DoFObjectAccessor<1, dim>::copy_from (a);
+ DoFObjectAccessor<1, dim, DoFHandler>::copy_from (a);
this->set_mg_dof_handler (a.mg_dof_handler);
}
template <int dim>
unsigned int MGDoFObjectAccessor<2, dim>::mg_dof_index (const unsigned int i) const
{
+ typedef DoFAccessor<dim, DoFHandler> BaseClass;
+
Assert (this->dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (this->mg_dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
// make sure a FE has been selected
// and enough room was reserved
Assert (&this->dof_handler->get_fe() != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (i<this->dof_handler->get_fe().dofs_per_quad,
ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_quad));
void MGDoFObjectAccessor<2, dim>::set_mg_dof_index (const unsigned int i,
const unsigned int index) const
{
+ typedef DoFAccessor<dim, DoFHandler> BaseClass;
+
Assert (this->dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (this->mg_dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
// make sure a FE has been selected
// and enough room was reserved
Assert (&this->dof_handler->get_fe() != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (i<this->dof_handler->get_fe().dofs_per_quad,
ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_quad));
unsigned int MGDoFObjectAccessor<2, dim>::mg_vertex_dof_index (const unsigned int vertex,
const unsigned int i) const
{
+ typedef DoFAccessor<dim, DoFHandler> BaseClass;
+
Assert (this->dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (this->mg_dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (&this->dof_handler->get_fe() != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (vertex<4, ExcIndexRange (i,0,4));
Assert (i<this->dof_handler->get_fe().dofs_per_vertex,
ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_vertex));
const unsigned int i,
const unsigned int index) const
{
+ typedef DoFAccessor<dim, DoFHandler> BaseClass;
+
Assert (this->dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (this->mg_dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (&this->dof_handler->get_fe() != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (vertex<4, ExcIndexRange (i,0,4));
Assert (i<this->dof_handler->get_fe().dofs_per_vertex,
ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_vertex));
void
MGDoFObjectAccessor<2, dim>::get_mg_dof_indices (std::vector<unsigned int> &dof_indices) const
{
+ typedef DoFAccessor<dim, DoFHandler> BaseClass;
+ typedef DoFAccessor<2, DoFHandler> BaseClass2D;
+
Assert (this->dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (this->mg_dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (&this->dof_handler->get_fe() != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (dof_indices.size() == (4*this->dof_handler->get_fe().dofs_per_vertex +
4*this->dof_handler->get_fe().dofs_per_line +
this->dof_handler->get_fe().dofs_per_quad),
- DoFAccessor<2>::ExcVectorDoesNotMatch());
+ typename BaseClass2D::ExcVectorDoesNotMatch());
const unsigned int dofs_per_vertex = this->dof_handler->get_fe().dofs_per_vertex,
dofs_per_line = this->dof_handler->get_fe().dofs_per_line,
MGDoFObjectAccessor<2,dim>::get_mg_dof_values (const Vector<number> &values,
Vector<number> &dof_values) const
{
- Assert (this->dof_handler != 0, DoFAccessor<2>::ExcInvalidObject());
- Assert (this->mg_dof_handler != 0, DoFAccessor<2>::ExcInvalidObject());
- Assert (&this->dof_handler->get_fe() != 0, DoFAccessor<2>::ExcInvalidObject());
+ typedef DoFAccessor<2, DoFHandler> BaseClass;
+
+ Assert (this->dof_handler != 0,
+ typename BaseClass::ExcInvalidObject());
+ Assert (this->mg_dof_handler != 0,
+ typename BaseClass::ExcInvalidObject());
+ Assert (&this->dof_handler->get_fe() != 0,
+ typename BaseClass::ExcInvalidObject());
Assert (dof_values.size() == this->dof_handler->get_fe().dofs_per_cell,
- DoFAccessor<2>::ExcVectorDoesNotMatch());
+ typename BaseClass::ExcVectorDoesNotMatch());
Assert (values.size() == this->mg_dof_handler->n_dofs(this->present_level),
- DoFAccessor<2>::ExcVectorDoesNotMatch());
+ typename BaseClass::ExcVectorDoesNotMatch());
const unsigned int dofs_per_vertex = this->dof_handler->get_fe().dofs_per_vertex,
dofs_per_line = this->dof_handler->get_fe().dofs_per_line,
void
MGDoFObjectAccessor<2, dim>::copy_from (const MGDoFObjectAccessor<2, dim> &a)
{
- DoFObjectAccessor<2, dim>::copy_from (a);
+ DoFObjectAccessor<2, dim, DoFHandler>::copy_from (a);
this->set_mg_dof_handler (a.mg_dof_handler);
}
template <int dim>
unsigned int MGDoFObjectAccessor<3, dim>::mg_dof_index (const unsigned int i) const
{
+ typedef DoFAccessor<dim, DoFHandler> BaseClass;
+
Assert (this->dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (this->mg_dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
// make sure a FE has been selected
// and enough room was reserved
Assert (&this->dof_handler->get_fe() != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (i<this->dof_handler->get_fe().dofs_per_hex,
ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_hex));
void MGDoFObjectAccessor<3, dim>::set_mg_dof_index (const unsigned int i,
const unsigned int index) const
{
+ typedef DoFAccessor<dim, DoFHandler> BaseClass;
+
Assert (this->dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (this->mg_dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
// make sure a FE has been selected
// and enough room was reserved
Assert (&this->dof_handler->get_fe() != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (i<this->dof_handler->get_fe().dofs_per_hex,
ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_hex));
unsigned int MGDoFObjectAccessor<3, dim>::mg_vertex_dof_index (const unsigned int vertex,
const unsigned int i) const
{
+ typedef DoFAccessor<dim, DoFHandler> BaseClass;
+
Assert (this->dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (this->mg_dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (&this->dof_handler->get_fe() != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (vertex<8, ExcIndexRange (i,0,8));
Assert (i<this->dof_handler->get_fe().dofs_per_vertex,
ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_vertex));
const unsigned int i,
const unsigned int index) const
{
+ typedef DoFAccessor<dim, DoFHandler> BaseClass;
+
Assert (this->dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (this->mg_dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (&this->dof_handler->get_fe() != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (vertex<8, ExcIndexRange (vertex,0,8));
Assert (i<this->dof_handler->get_fe().dofs_per_vertex,
ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_vertex));
void
MGDoFObjectAccessor<3, dim>::get_mg_dof_indices (std::vector<unsigned int> &dof_indices) const
{
+ typedef DoFAccessor<dim, DoFHandler> BaseClass;
+ typedef DoFAccessor<3, DoFHandler> BaseClass3D;
+
Assert (this->dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (this->mg_dof_handler != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (&this->dof_handler->get_fe() != 0,
- typename DoFAccessor<dim>::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (dof_indices.size() == (8*this->dof_handler->get_fe().dofs_per_vertex +
12*this->dof_handler->get_fe().dofs_per_line +
6*this->dof_handler->get_fe().dofs_per_quad +
this->dof_handler->get_fe().dofs_per_hex),
- DoFAccessor<3>::ExcVectorDoesNotMatch());
+ typename BaseClass3D::ExcVectorDoesNotMatch());
const unsigned int dofs_per_vertex = this->dof_handler->get_fe().dofs_per_vertex,
dofs_per_line = this->dof_handler->get_fe().dofs_per_line,
MGDoFObjectAccessor<3,dim>::get_mg_dof_values (const Vector<number> &values,
Vector<number> &dof_values) const
{
- Assert (this->dof_handler != 0, DoFAccessor<2>::ExcInvalidObject());
- Assert (this->mg_dof_handler != 0, DoFAccessor<2>::ExcInvalidObject());
- Assert (&this->dof_handler->get_fe() != 0, DoFAccessor<2>::ExcInvalidObject());
+ typedef DoFAccessor<3, DoFHandler> BaseClass;
+
+ Assert (this->dof_handler != 0,
+ typename BaseClass::ExcInvalidObject());
+ Assert (this->mg_dof_handler != 0,
+ typename BaseClass::ExcInvalidObject());
+ Assert (&this->dof_handler->get_fe() != 0,
+ typename BaseClass::ExcInvalidObject());
Assert (dof_values.size() == this->dof_handler->get_fe().dofs_per_cell,
- DoFAccessor<3>::ExcVectorDoesNotMatch());
+ typename BaseClass::ExcVectorDoesNotMatch());
Assert (values.size() == this->mg_dof_handler->n_dofs(this->present_level),
- DoFAccessor<3>::ExcVectorDoesNotMatch());
+ typename BaseClass::ExcVectorDoesNotMatch());
const unsigned int dofs_per_vertex = this->dof_handler->get_fe().dofs_per_vertex,
dofs_per_line = this->dof_handler->get_fe().dofs_per_line,
template <int dim>
void
MGDoFObjectAccessor<3, dim>::copy_from (const MGDoFObjectAccessor<3, dim> &a) {
- DoFObjectAccessor<3, dim>::copy_from (a);
+ DoFObjectAccessor<3, dim, DoFHandler>::copy_from (a);
this->set_mg_dof_handler (a.mg_dof_handler);
}
template <int dim>
-MGDoFHandler<dim>::MGVertexDoFs::~MGVertexDoFs () {
+MGDoFHandler<dim>::MGVertexDoFs::~MGVertexDoFs ()
+{
delete[] indices;
}
template <>
MGDoFHandler<1>::raw_cell_iterator
-MGDoFHandler<1>::begin_raw (const unsigned int level) const {
+MGDoFHandler<1>::begin_raw (const unsigned int level) const
+{
return begin_raw_line (level);
}
template <>
MGDoFHandler<1>::cell_iterator
-MGDoFHandler<1>::begin (const unsigned int level) const {
+MGDoFHandler<1>::begin (const unsigned int level) const
+{
return begin_line (level);
}
template <>
MGDoFHandler<1>::active_cell_iterator
-MGDoFHandler<1>::begin_active (const unsigned int level) const {
+MGDoFHandler<1>::begin_active (const unsigned int level) const
+{
return begin_active_line (level);
}
template <>
MGDoFHandler<1>::raw_cell_iterator
-MGDoFHandler<1>::end () const {
+MGDoFHandler<1>::end () const
+{
return end_line ();
}
template <>
MGDoFHandler<1>::raw_cell_iterator
-MGDoFHandler<1>::last_raw () const {
+MGDoFHandler<1>::last_raw () const
+{
return last_raw_line ();
}
template <>
MGDoFHandler<1>::raw_cell_iterator
-MGDoFHandler<1>::last_raw (const unsigned int level) const {
+MGDoFHandler<1>::last_raw (const unsigned int level) const
+{
return last_raw_line (level);
}
template <>
MGDoFHandler<1>::cell_iterator
-MGDoFHandler<1>::last () const {
+MGDoFHandler<1>::last () const
+{
return last_line ();
}
template <>
MGDoFHandler<1>::cell_iterator
-MGDoFHandler<1>::last (const unsigned int level) const {
+MGDoFHandler<1>::last (const unsigned int level) const
+{
return last_line (level);
}
template <>
MGDoFHandler<1>::active_cell_iterator
-MGDoFHandler<1>::last_active () const {
+MGDoFHandler<1>::last_active () const
+{
return last_active_line ();
}
template <>
MGDoFHandler<1>::active_cell_iterator
-MGDoFHandler<1>::last_active (const unsigned int level) const {
+MGDoFHandler<1>::last_active (const unsigned int level) const
+{
return last_active_line (level);
}
template <>
MGDoFDimensionInfo<1>::raw_face_iterator
-MGDoFHandler<1>::begin_raw_face (const unsigned int) const {
+MGDoFHandler<1>::begin_raw_face (const unsigned int) const
+{
Assert (false, ExcImpossibleInDim(1));
return 0;
}
template <>
MGDoFDimensionInfo<1>::face_iterator
-MGDoFHandler<1>::begin_face (const unsigned int) const {
+MGDoFHandler<1>::begin_face (const unsigned int) const
+{
Assert (false, ExcImpossibleInDim(1));
return 0;
}
template <>
MGDoFDimensionInfo<1>::active_face_iterator
-MGDoFHandler<1>::begin_active_face (const unsigned int) const {
+MGDoFHandler<1>::begin_active_face (const unsigned int) const
+{
Assert (false, ExcImpossibleInDim(1));
return 0;
}
template <>
MGDoFDimensionInfo<1>::raw_face_iterator
-MGDoFHandler<1>::end_face () const {
+MGDoFHandler<1>::end_face () const
+{
Assert (false, ExcImpossibleInDim(1));
return 0;
}
template <>
MGDoFDimensionInfo<1>::raw_face_iterator
-MGDoFHandler<1>::last_raw_face () const {
+MGDoFHandler<1>::last_raw_face () const
+{
Assert (false, ExcImpossibleInDim(1));
return 0;
}
template <>
MGDoFDimensionInfo<1>::raw_face_iterator
-MGDoFHandler<1>::last_raw_face (const unsigned int) const {
+MGDoFHandler<1>::last_raw_face (const unsigned int) const
+{
Assert (false, ExcImpossibleInDim(1));
return 0;
}
template <>
MGDoFDimensionInfo<1>::face_iterator
-MGDoFHandler<1>::last_face () const {
+MGDoFHandler<1>::last_face () const
+{
Assert (false, ExcImpossibleInDim(1));
return 0;
}
template <>
MGDoFDimensionInfo<1>::face_iterator
-MGDoFHandler<1>::last_face (const unsigned int) const {
+MGDoFHandler<1>::last_face (const unsigned int) const
+{
Assert (false, ExcImpossibleInDim(1));
return 0;
}
template <>
MGDoFDimensionInfo<1>::active_face_iterator
-MGDoFHandler<1>::last_active_face () const {
+MGDoFHandler<1>::last_active_face () const
+{
Assert (false, ExcImpossibleInDim(1));
return 0;
}
template <>
MGDoFDimensionInfo<1>::active_face_iterator
-MGDoFHandler<1>::last_active_face (const unsigned int) const {
+MGDoFHandler<1>::last_active_face (const unsigned int) const
+{
Assert (false, ExcImpossibleInDim(1));
return 0;
}
template <>
MGDoFHandler<1>::raw_quad_iterator
-MGDoFHandler<1>::begin_raw_quad (const unsigned int) const {
+MGDoFHandler<1>::begin_raw_quad (const unsigned int) const
+{
Assert (false, ExcImpossibleInDim(1));
return 0;
}
template <>
MGDoFHandler<1>::quad_iterator
-MGDoFHandler<1>::begin_quad (const unsigned int) const {
+MGDoFHandler<1>::begin_quad (const unsigned int) const
+{
Assert (false, ExcImpossibleInDim(1));
return 0;
}
template <>
MGDoFHandler<1>::active_quad_iterator
-MGDoFHandler<1>::begin_active_quad (const unsigned int) const {
+MGDoFHandler<1>::begin_active_quad (const unsigned int) const
+{
Assert (false, ExcImpossibleInDim(1));
return 0;
}
template <>
MGDoFHandler<1>::raw_quad_iterator
-MGDoFHandler<1>::end_quad () const {
+MGDoFHandler<1>::end_quad () const
+{
Assert (false, ExcImpossibleInDim(1));
return 0;
}
template <>
MGDoFHandler<1>::raw_quad_iterator
-MGDoFHandler<1>::last_raw_quad (const unsigned int) const {
+MGDoFHandler<1>::last_raw_quad (const unsigned int) const
+{
Assert (false, ExcImpossibleInDim(1));
return 0;
}
template <>
MGDoFHandler<1>::quad_iterator
-MGDoFHandler<1>::last_quad (const unsigned int) const {
+MGDoFHandler<1>::last_quad (const unsigned int) const
+{
Assert (false, ExcImpossibleInDim(1));
return 0;
}
template <>
MGDoFHandler<1>::active_quad_iterator
-MGDoFHandler<1>::last_active_quad (const unsigned int) const {
+MGDoFHandler<1>::last_active_quad (const unsigned int) const
+{
Assert (false, ExcImpossibleInDim(1));
return 0;
}
template <>
MGDoFHandler<1>::raw_quad_iterator
-MGDoFHandler<1>::last_raw_quad () const {
+MGDoFHandler<1>::last_raw_quad () const
+{
Assert (false, ExcImpossibleInDim(1));
return 0;
}
template <>
MGDoFHandler<1>::quad_iterator
-MGDoFHandler<1>::last_quad () const {
+MGDoFHandler<1>::last_quad () const
+{
Assert (false, ExcImpossibleInDim(1));
return 0;
}
template <>
MGDoFHandler<1>::active_quad_iterator
-MGDoFHandler<1>::last_active_quad () const {
+MGDoFHandler<1>::last_active_quad () const
+{
Assert (false, ExcImpossibleInDim(1));
return 0;
}
template <>
MGDoFHandler<1>::raw_hex_iterator
-MGDoFHandler<1>::begin_raw_hex (const unsigned int) const {
+MGDoFHandler<1>::begin_raw_hex (const unsigned int) const
+{
Assert (false, ExcImpossibleInDim(1));
return 0;
}
template <>
MGDoFHandler<1>::hex_iterator
-MGDoFHandler<1>::begin_hex (const unsigned int) const {
+MGDoFHandler<1>::begin_hex (const unsigned int) const
+{
Assert (false, ExcImpossibleInDim(1));
return 0;
}
template <>
MGDoFHandler<1>::active_hex_iterator
-MGDoFHandler<1>::begin_active_hex (const unsigned int) const {
+MGDoFHandler<1>::begin_active_hex (const unsigned int) const
+{
Assert (false, ExcImpossibleInDim(1));
return 0;
}
template <>
MGDoFHandler<1>::raw_hex_iterator
-MGDoFHandler<1>::end_hex () const {
+MGDoFHandler<1>::end_hex () const
+{
Assert (false, ExcImpossibleInDim(1));
return 0;
}
template <>
MGDoFHandler<1>::raw_hex_iterator
-MGDoFHandler<1>::last_raw_hex (const unsigned int) const {
+MGDoFHandler<1>::last_raw_hex (const unsigned int) const
+{
Assert (false, ExcImpossibleInDim(1));
return 0;
}
template <>
MGDoFHandler<1>::hex_iterator
-MGDoFHandler<1>::last_hex (const unsigned int) const {
+MGDoFHandler<1>::last_hex (const unsigned int) const
+{
Assert (false, ExcImpossibleInDim(1));
return 0;
}
template <>
MGDoFHandler<1>::active_hex_iterator
-MGDoFHandler<1>::last_active_hex (const unsigned int) const {
+MGDoFHandler<1>::last_active_hex (const unsigned int) const
+{
Assert (false, ExcImpossibleInDim(1));
return 0;
}
template <>
MGDoFHandler<1>::raw_hex_iterator
-MGDoFHandler<1>::last_raw_hex () const {
+MGDoFHandler<1>::last_raw_hex () const
+{
Assert (false, ExcImpossibleInDim(1));
return 0;
}
template <>
MGDoFHandler<1>::hex_iterator
-MGDoFHandler<1>::last_hex () const {
+MGDoFHandler<1>::last_hex () const
+{
Assert (false, ExcImpossibleInDim(1));
return 0;
}
template <>
MGDoFHandler<1>::active_hex_iterator
-MGDoFHandler<1>::last_active_hex () const {
+MGDoFHandler<1>::last_active_hex () const
+{
Assert (false, ExcImpossibleInDim(1));
return 0;
}
template <>
MGDoFHandler<2>::raw_cell_iterator
-MGDoFHandler<2>::begin_raw (const unsigned int level) const {
+MGDoFHandler<2>::begin_raw (const unsigned int level) const
+{
return begin_raw_quad (level);
}
template <>
MGDoFHandler<2>::cell_iterator
-MGDoFHandler<2>::begin (const unsigned int level) const {
+MGDoFHandler<2>::begin (const unsigned int level) const
+{
return begin_quad (level);
}
template <>
MGDoFHandler<2>::active_cell_iterator
-MGDoFHandler<2>::begin_active (const unsigned int level) const {
+MGDoFHandler<2>::begin_active (const unsigned int level) const
+{
return begin_active_quad (level);
}
template <>
MGDoFHandler<2>::raw_cell_iterator
-MGDoFHandler<2>::end () const {
+MGDoFHandler<2>::end () const
+{
return end_quad ();
}
template <>
MGDoFHandler<2>::raw_cell_iterator
-MGDoFHandler<2>::last_raw () const {
+MGDoFHandler<2>::last_raw () const
+{
return last_raw_quad ();
}
template <>
MGDoFHandler<2>::raw_cell_iterator
-MGDoFHandler<2>::last_raw (const unsigned int level) const {
+MGDoFHandler<2>::last_raw (const unsigned int level) const
+{
return last_raw_quad (level);
}
template <>
MGDoFHandler<2>::cell_iterator
-MGDoFHandler<2>::last () const {
+MGDoFHandler<2>::last () const
+{
return last_quad ();
}
template <>
MGDoFHandler<2>::cell_iterator
-MGDoFHandler<2>::last (const unsigned int level) const {
+MGDoFHandler<2>::last (const unsigned int level) const
+{
return last_quad (level);
}
template <>
MGDoFHandler<2>::active_cell_iterator
-MGDoFHandler<2>::last_active () const {
+MGDoFHandler<2>::last_active () const
+{
return last_active_quad ();
}
template <>
MGDoFHandler<2>::active_cell_iterator
-MGDoFHandler<2>::last_active (const unsigned int level) const {
+MGDoFHandler<2>::last_active (const unsigned int level) const
+{
return last_active_quad (level);
}
template <>
MGDoFDimensionInfo<2>::raw_face_iterator
-MGDoFHandler<2>::begin_raw_face (const unsigned int level) const {
+MGDoFHandler<2>::begin_raw_face (const unsigned int level) const
+{
return begin_raw_line (level);
}
template <>
MGDoFDimensionInfo<2>::face_iterator
-MGDoFHandler<2>::begin_face (const unsigned int level) const {
+MGDoFHandler<2>::begin_face (const unsigned int level) const
+{
return begin_line (level);
}
template <>
MGDoFDimensionInfo<2>::active_face_iterator
-MGDoFHandler<2>::begin_active_face (const unsigned int level) const {
+MGDoFHandler<2>::begin_active_face (const unsigned int level) const
+{
return begin_active_line (level);
}
template <>
MGDoFDimensionInfo<2>::raw_face_iterator
-MGDoFHandler<2>::end_face () const {
+MGDoFHandler<2>::end_face () const
+{
return end_line ();
}
template <>
MGDoFDimensionInfo<2>::raw_face_iterator
-MGDoFHandler<2>::last_raw_face () const {
+MGDoFHandler<2>::last_raw_face () const
+{
return last_raw_line ();
}
template <>
MGDoFDimensionInfo<2>::raw_face_iterator
-MGDoFHandler<2>::last_raw_face (const unsigned int level) const {
+MGDoFHandler<2>::last_raw_face (const unsigned int level) const
+{
return last_raw_line (level);
}
template <>
MGDoFDimensionInfo<2>::face_iterator
-MGDoFHandler<2>::last_face () const {
+MGDoFHandler<2>::last_face () const
+{
return last_line ();
}
template <>
MGDoFDimensionInfo<2>::face_iterator
-MGDoFHandler<2>::last_face (const unsigned int level) const {
+MGDoFHandler<2>::last_face (const unsigned int level) const
+{
return last_line (level);
}
template <>
MGDoFDimensionInfo<2>::active_face_iterator
-MGDoFHandler<2>::last_active_face () const {
+MGDoFHandler<2>::last_active_face () const
+{
return last_active_line ();
}
template <>
MGDoFDimensionInfo<2>::active_face_iterator
-MGDoFHandler<2>::last_active_face (const unsigned int level) const {
+MGDoFHandler<2>::last_active_face (const unsigned int level) const
+{
return last_active_line (level);
}
template <>
MGDoFHandler<2>::raw_hex_iterator
-MGDoFHandler<2>::begin_raw_hex (const unsigned int) const {
+MGDoFHandler<2>::begin_raw_hex (const unsigned int) const
+{
Assert (false, ExcImpossibleInDim(2));
return 0;
}
template <>
MGDoFHandler<2>::hex_iterator
-MGDoFHandler<2>::begin_hex (const unsigned int) const {
+MGDoFHandler<2>::begin_hex (const unsigned int) const
+{
Assert (false, ExcImpossibleInDim(2));
return 0;
}
template <>
MGDoFHandler<2>::active_hex_iterator
-MGDoFHandler<2>::begin_active_hex (const unsigned int) const {
+MGDoFHandler<2>::begin_active_hex (const unsigned int) const
+{
Assert (false, ExcImpossibleInDim(2));
return 0;
}
template <>
MGDoFHandler<2>::raw_hex_iterator
-MGDoFHandler<2>::end_hex () const {
+MGDoFHandler<2>::end_hex () const
+{
Assert (false, ExcImpossibleInDim(2));
return 0;
}
template <>
MGDoFHandler<2>::raw_hex_iterator
-MGDoFHandler<2>::last_raw_hex (const unsigned int) const {
+MGDoFHandler<2>::last_raw_hex (const unsigned int) const
+{
Assert (false, ExcImpossibleInDim(2));
return 0;
}
template <>
MGDoFHandler<2>::hex_iterator
-MGDoFHandler<2>::last_hex (const unsigned int) const {
+MGDoFHandler<2>::last_hex (const unsigned int) const
+{
Assert (false, ExcImpossibleInDim(2));
return 0;
}
template <>
MGDoFHandler<2>::active_hex_iterator
-MGDoFHandler<2>::last_active_hex (const unsigned int) const {
+MGDoFHandler<2>::last_active_hex (const unsigned int) const
+{
Assert (false, ExcImpossibleInDim(2));
return 0;
}
template <>
MGDoFHandler<2>::raw_hex_iterator
-MGDoFHandler<2>::last_raw_hex () const {
+MGDoFHandler<2>::last_raw_hex () const
+{
Assert (false, ExcImpossibleInDim(2));
return 0;
}
template <>
MGDoFHandler<2>::hex_iterator
-MGDoFHandler<2>::last_hex () const {
+MGDoFHandler<2>::last_hex () const
+{
Assert (false, ExcImpossibleInDim(2));
return 0;
}
template <>
MGDoFHandler<2>::active_hex_iterator
-MGDoFHandler<2>::last_active_hex () const {
+MGDoFHandler<2>::last_active_hex () const
+{
Assert (false, ExcImpossibleInDim(2));
return 0;
}
template <>
MGDoFHandler<3>::raw_cell_iterator
-MGDoFHandler<3>::begin_raw (const unsigned int level) const {
+MGDoFHandler<3>::begin_raw (const unsigned int level) const
+{
return begin_raw_hex (level);
}
template <>
MGDoFHandler<3>::cell_iterator
-MGDoFHandler<3>::begin (const unsigned int level) const {
+MGDoFHandler<3>::begin (const unsigned int level) const
+{
return begin_hex (level);
}
template <>
MGDoFHandler<3>::active_cell_iterator
-MGDoFHandler<3>::begin_active (const unsigned int level) const {
+MGDoFHandler<3>::begin_active (const unsigned int level) const
+{
return begin_active_hex (level);
}
template <>
MGDoFHandler<3>::raw_cell_iterator
-MGDoFHandler<3>::end () const {
+MGDoFHandler<3>::end () const
+{
return end_hex ();
}
template <>
MGDoFHandler<3>::raw_cell_iterator
-MGDoFHandler<3>::last_raw () const {
+MGDoFHandler<3>::last_raw () const
+{
return last_raw_hex ();
}
template <>
MGDoFHandler<3>::raw_cell_iterator
-MGDoFHandler<3>::last_raw (const unsigned int level) const {
+MGDoFHandler<3>::last_raw (const unsigned int level) const
+{
return last_raw_hex (level);
}
template <>
MGDoFHandler<3>::cell_iterator
-MGDoFHandler<3>::last () const {
+MGDoFHandler<3>::last () const
+{
return last_hex ();
}
template <>
MGDoFHandler<3>::cell_iterator
-MGDoFHandler<3>::last (const unsigned int level) const {
+MGDoFHandler<3>::last (const unsigned int level) const
+{
return last_hex (level);
}
template <>
MGDoFHandler<3>::active_cell_iterator
-MGDoFHandler<3>::last_active () const {
+MGDoFHandler<3>::last_active () const
+{
return last_active_hex ();
}
template <>
MGDoFHandler<3>::active_cell_iterator
-MGDoFHandler<3>::last_active (const unsigned int level) const {
+MGDoFHandler<3>::last_active (const unsigned int level) const
+{
return last_active_hex (level);
}
template <>
MGDoFDimensionInfo<3>::raw_face_iterator
-MGDoFHandler<3>::begin_raw_face (const unsigned int level) const {
+MGDoFHandler<3>::begin_raw_face (const unsigned int level) const
+{
return begin_raw_quad (level);
}
template <>
MGDoFDimensionInfo<3>::face_iterator
-MGDoFHandler<3>::begin_face (const unsigned int level) const {
+MGDoFHandler<3>::begin_face (const unsigned int level) const
+{
return begin_quad (level);
}
template <>
MGDoFDimensionInfo<3>::active_face_iterator
-MGDoFHandler<3>::begin_active_face (const unsigned int level) const {
+MGDoFHandler<3>::begin_active_face (const unsigned int level) const
+{
return begin_active_quad (level);
}
template <>
MGDoFDimensionInfo<3>::raw_face_iterator
-MGDoFHandler<3>::end_face () const {
+MGDoFHandler<3>::end_face () const
+{
return end_quad ();
}
template <>
MGDoFDimensionInfo<3>::raw_face_iterator
-MGDoFHandler<3>::last_raw_face () const {
+MGDoFHandler<3>::last_raw_face () const
+{
return last_raw_quad ();
}
template <>
MGDoFDimensionInfo<3>::raw_face_iterator
-MGDoFHandler<3>::last_raw_face (const unsigned int level) const {
+MGDoFHandler<3>::last_raw_face (const unsigned int level) const
+{
return last_raw_quad (level);
}
template <>
MGDoFDimensionInfo<3>::face_iterator
-MGDoFHandler<3>::last_face () const {
+MGDoFHandler<3>::last_face () const
+{
return last_quad ();
}
template <>
MGDoFDimensionInfo<3>::face_iterator
-MGDoFHandler<3>::last_face (const unsigned int level) const {
+MGDoFHandler<3>::last_face (const unsigned int level) const
+{
return last_quad (level);
}
template <>
MGDoFDimensionInfo<3>::active_face_iterator
-MGDoFHandler<3>::last_active_face () const {
+MGDoFHandler<3>::last_active_face () const
+{
return last_active_quad ();
}
template <>
MGDoFDimensionInfo<3>::active_face_iterator
-MGDoFHandler<3>::last_active_face (const unsigned int level) const {
+MGDoFHandler<3>::last_active_face (const unsigned int level) const
+{
return last_active_quad (level);
}
template <int dim>
typename MGDoFHandler<dim>::raw_line_iterator
-MGDoFHandler<dim>::begin_raw_line (const unsigned int level) const {
+MGDoFHandler<dim>::begin_raw_line (const unsigned int level) const
+{
return raw_line_iterator (this->tria,
this->tria->begin_raw_line(level)->level(),
this->tria->begin_raw_line(level)->index(),
template <int dim>
typename MGDoFHandler<dim>::line_iterator
-MGDoFHandler<dim>::begin_line (const unsigned int level) const {
+MGDoFHandler<dim>::begin_line (const unsigned int level) const
+{
return line_iterator (this->tria,
this->tria->begin_line(level)->level(),
this->tria->begin_line(level)->index(),
template <int dim>
typename MGDoFHandler<dim>::active_line_iterator
-MGDoFHandler<dim>::begin_active_line (const unsigned int level) const {
+MGDoFHandler<dim>::begin_active_line (const unsigned int level) const
+{
return active_line_iterator (this->tria,
this->tria->begin_active_line(level)->level(),
this->tria->begin_active_line(level)->index(),
template <int dim>
typename MGDoFHandler<dim>::raw_quad_iterator
-MGDoFHandler<dim>::begin_raw_quad (const unsigned int level) const {
+MGDoFHandler<dim>::begin_raw_quad (const unsigned int level) const
+{
return raw_quad_iterator (this->tria,
this->tria->begin_raw_quad(level)->level(),
this->tria->begin_raw_quad(level)->index(),
template <int dim>
typename MGDoFHandler<dim>::quad_iterator
-MGDoFHandler<dim>::begin_quad (const unsigned int level) const {
+MGDoFHandler<dim>::begin_quad (const unsigned int level) const
+{
return quad_iterator (this->tria,
this->tria->begin_quad(level)->level(),
this->tria->begin_quad(level)->index(),
template <int dim>
typename MGDoFHandler<dim>::active_quad_iterator
-MGDoFHandler<dim>::begin_active_quad (const unsigned int level) const {
+MGDoFHandler<dim>::begin_active_quad (const unsigned int level) const
+{
return active_quad_iterator (this->tria,
this->tria->begin_active_quad(level)->level(),
this->tria->begin_active_quad(level)->index(),
template <int dim>
typename MGDoFHandler<dim>::raw_hex_iterator
-MGDoFHandler<dim>::begin_raw_hex (const unsigned int level) const {
+MGDoFHandler<dim>::begin_raw_hex (const unsigned int level) const
+{
return raw_hex_iterator (this->tria,
this->tria->begin_raw_hex(level)->level(),
this->tria->begin_raw_hex(level)->index(),
template <int dim>
typename MGDoFHandler<dim>::hex_iterator
-MGDoFHandler<dim>::begin_hex (const unsigned int level) const {
+MGDoFHandler<dim>::begin_hex (const unsigned int level) const
+{
return hex_iterator (this->tria,
this->tria->begin_hex(level)->level(),
this->tria->begin_hex(level)->index(),
template <int dim>
typename MGDoFHandler<dim>::active_hex_iterator
-MGDoFHandler<dim>::begin_active_hex (const unsigned int level) const {
+MGDoFHandler<dim>::begin_active_hex (const unsigned int level) const
+{
return active_hex_iterator (this->tria,
this->tria->begin_active_hex(level)->level(),
this->tria->begin_active_hex(level)->index(),
template <int dim>
typename MGDoFHandler<dim>::raw_line_iterator
-MGDoFHandler<dim>::end_line () const {
+MGDoFHandler<dim>::end_line () const
+{
return raw_line_iterator (this->tria, -1, -1, this);
}
template <int dim>
typename MGDoFHandler<dim>::raw_quad_iterator
-MGDoFHandler<dim>::end_quad () const {
+MGDoFHandler<dim>::end_quad () const
+{
return raw_quad_iterator (this->tria, -1, -1, this);
}
template <int dim>
typename MGDoFHandler<dim>::raw_hex_iterator
-MGDoFHandler<dim>::end_hex () const {
+MGDoFHandler<dim>::end_hex () const
+{
return raw_hex_iterator (this->tria, -1, -1, this);
}
template <int dim>
typename MGDoFDimensionInfo<dim>::raw_cell_iterator
-MGDoFHandler<dim>::end_raw (const unsigned int level) const {
+MGDoFHandler<dim>::end_raw (const unsigned int level) const
+{
return (level == mg_levels.size()-1 ?
end() :
begin_raw (level+1));
template <int dim>
typename MGDoFDimensionInfo<dim>::cell_iterator
-MGDoFHandler<dim>::end (const unsigned int level) const {
+MGDoFHandler<dim>::end (const unsigned int level) const
+{
return (level == mg_levels.size()-1 ?
cell_iterator(end()) :
begin (level+1));
template <int dim>
typename MGDoFDimensionInfo<dim>::active_cell_iterator
-MGDoFHandler<dim>::end_active (const unsigned int level) const {
+MGDoFHandler<dim>::end_active (const unsigned int level) const
+{
return (level == mg_levels.size()-1 ?
active_cell_iterator(end()) :
begin_active (level+1));
template <int dim>
typename MGDoFDimensionInfo<dim>::raw_face_iterator
-MGDoFHandler<dim>::end_raw_face (const unsigned int level) const {
+MGDoFHandler<dim>::end_raw_face (const unsigned int level) const
+{
return (level == mg_levels.size()-1 ?
end_face() :
begin_raw_face (level+1));
template <int dim>
typename MGDoFDimensionInfo<dim>::face_iterator
-MGDoFHandler<dim>::end_face (const unsigned int level) const {
+MGDoFHandler<dim>::end_face (const unsigned int level) const
+{
return (level == mg_levels.size()-1 ?
face_iterator(end_face()) :
begin_face (level+1));
template <int dim>
typename MGDoFDimensionInfo<dim>::active_face_iterator
-MGDoFHandler<dim>::end_active_face (const unsigned int level) const {
+MGDoFHandler<dim>::end_active_face (const unsigned int level) const
+{
return (level == mg_levels.size()-1 ?
active_face_iterator(end_face()) :
begin_active_face (level+1));
template <int dim>
typename MGDoFDimensionInfo<dim>::raw_line_iterator
-MGDoFHandler<dim>::end_raw_line (const unsigned int level) const {
+MGDoFHandler<dim>::end_raw_line (const unsigned int level) const
+{
return (level == mg_levels.size()-1 ?
end_line() :
begin_raw_line (level+1));
template <int dim>
typename MGDoFDimensionInfo<dim>::line_iterator
-MGDoFHandler<dim>::end_line (const unsigned int level) const {
+MGDoFHandler<dim>::end_line (const unsigned int level) const
+{
return (level == mg_levels.size()-1 ?
line_iterator(end_line()) :
begin_line (level+1));
template <int dim>
typename MGDoFDimensionInfo<dim>::active_line_iterator
-MGDoFHandler<dim>::end_active_line (const unsigned int level) const {
+MGDoFHandler<dim>::end_active_line (const unsigned int level) const
+{
return (level == mg_levels.size()-1 ?
active_line_iterator(end_line()) :
begin_active_line (level+1));
template <int dim>
typename MGDoFDimensionInfo<dim>::raw_quad_iterator
-MGDoFHandler<dim>::end_raw_quad (const unsigned int level) const {
+MGDoFHandler<dim>::end_raw_quad (const unsigned int level) const
+{
return (level == mg_levels.size()-1 ?
end_quad() :
begin_raw_quad (level+1));
template <int dim>
typename MGDoFDimensionInfo<dim>::quad_iterator
-MGDoFHandler<dim>::end_quad (const unsigned int level) const {
+MGDoFHandler<dim>::end_quad (const unsigned int level) const
+{
return (level == mg_levels.size()-1 ?
quad_iterator(end_quad()) :
begin_quad (level+1));
template <int dim>
typename MGDoFDimensionInfo<dim>::active_quad_iterator
-MGDoFHandler<dim>::end_active_quad (const unsigned int level) const {
+MGDoFHandler<dim>::end_active_quad (const unsigned int level) const
+{
return (level == mg_levels.size()-1 ?
active_quad_iterator(end_quad()) :
begin_active_quad (level+1));
template <int dim>
typename MGDoFDimensionInfo<dim>::raw_hex_iterator
-MGDoFHandler<dim>::end_raw_hex (const unsigned int level) const {
+MGDoFHandler<dim>::end_raw_hex (const unsigned int level) const
+{
return (level == mg_levels.size()-1 ?
end_hex() :
begin_raw_hex (level+1));
template <int dim>
typename MGDoFDimensionInfo<dim>::hex_iterator
-MGDoFHandler<dim>::end_hex (const unsigned int level) const {
+MGDoFHandler<dim>::end_hex (const unsigned int level) const
+{
return (level == mg_levels.size()-1 ?
hex_iterator(end_hex()) :
begin_hex (level+1));
template <int dim>
typename MGDoFDimensionInfo<dim>::active_hex_iterator
-MGDoFHandler<dim>::end_active_hex (const unsigned int level) const {
+MGDoFHandler<dim>::end_active_hex (const unsigned int level) const
+{
return (level == mg_levels.size()-1 ?
active_hex_iterator(end_hex()) :
begin_active_hex (level+1));
template <int dim>
typename MGDoFHandler<dim>::raw_line_iterator
-MGDoFHandler<dim>::last_raw_line (const unsigned int level) const {
+MGDoFHandler<dim>::last_raw_line (const unsigned int level) const
+{
return raw_line_iterator (this->tria,
this->tria->last_raw_line(level)->level(),
this->tria->last_raw_line(level)->index(),
template <int dim>
typename MGDoFHandler<dim>::line_iterator
-MGDoFHandler<dim>::last_line (const unsigned int level) const {
+MGDoFHandler<dim>::last_line (const unsigned int level) const
+{
return line_iterator (this->tria,
this->tria->last_line(level)->level(),
this->tria->last_line(level)->index(),
template <int dim>
typename MGDoFHandler<dim>::active_line_iterator
-MGDoFHandler<dim>::last_active_line (const unsigned int level) const {
+MGDoFHandler<dim>::last_active_line (const unsigned int level) const
+{
return active_line_iterator (this->tria,
this->tria->last_active_line(level)->level(),
this->tria->last_active_line(level)->index(),
template <int dim>
typename MGDoFHandler<dim>::raw_quad_iterator
-MGDoFHandler<dim>::last_raw_quad (const unsigned int level) const {
+MGDoFHandler<dim>::last_raw_quad (const unsigned int level) const
+{
return raw_quad_iterator (this->tria,
this->tria->last_raw_quad(level)->level(),
this->tria->last_raw_quad(level)->index(),
template <int dim>
typename MGDoFHandler<dim>::quad_iterator
-MGDoFHandler<dim>::last_quad (const unsigned int level) const {
+MGDoFHandler<dim>::last_quad (const unsigned int level) const
+{
return quad_iterator (this->tria,
this->tria->last_quad(level)->level(),
this->tria->last_quad(level)->index(),
template <int dim>
typename MGDoFHandler<dim>::active_quad_iterator
-MGDoFHandler<dim>::last_active_quad (const unsigned int level) const {
+MGDoFHandler<dim>::last_active_quad (const unsigned int level) const
+{
return active_quad_iterator (this->tria,
this->tria->last_active_quad(level)->level(),
this->tria->last_active_quad(level)->index(),
template <int dim>
typename MGDoFHandler<dim>::raw_hex_iterator
-MGDoFHandler<dim>::last_raw_hex (const unsigned int level) const {
+MGDoFHandler<dim>::last_raw_hex (const unsigned int level) const
+{
return raw_hex_iterator (this->tria,
this->tria->last_raw_hex(level)->level(),
this->tria->last_raw_hex(level)->index(),
template <int dim>
typename MGDoFHandler<dim>::hex_iterator
-MGDoFHandler<dim>::last_hex (const unsigned int level) const {
+MGDoFHandler<dim>::last_hex (const unsigned int level) const
+{
return hex_iterator (this->tria,
this->tria->last_hex(level)->level(),
this->tria->last_hex(level)->index(),
template <int dim>
typename MGDoFHandler<dim>::active_hex_iterator
-MGDoFHandler<dim>::last_active_hex (const unsigned int level) const {
+MGDoFHandler<dim>::last_active_hex (const unsigned int level) const
+{
return active_hex_iterator (this->tria,
this->tria->last_active_hex(level)->level(),
this->tria->last_active_hex(level)->index(),
template <int dim>
typename MGDoFHandler<dim>::raw_line_iterator
-MGDoFHandler<dim>::last_raw_line () const {
+MGDoFHandler<dim>::last_raw_line () const
+{
return last_raw_line (mg_levels.size()-1);
}
template <int dim>
typename MGDoFHandler<dim>::raw_quad_iterator
-MGDoFHandler<dim>::last_raw_quad () const {
+MGDoFHandler<dim>::last_raw_quad () const
+{
return last_raw_quad (mg_levels.size()-1);
}
template <int dim>
typename MGDoFHandler<dim>::raw_hex_iterator
-MGDoFHandler<dim>::last_raw_hex () const {
+MGDoFHandler<dim>::last_raw_hex () const
+{
return last_raw_hex (mg_levels.size()-1);
}
template <int dim>
typename MGDoFHandler<dim>::line_iterator
-MGDoFHandler<dim>::last_line () const {
+MGDoFHandler<dim>::last_line () const
+{
return last_line (mg_levels.size()-1);
}
template <int dim>
typename MGDoFHandler<dim>::quad_iterator
-MGDoFHandler<dim>::last_quad () const {
+MGDoFHandler<dim>::last_quad () const
+{
return last_quad (mg_levels.size()-1);
}
template <int dim>
typename MGDoFHandler<dim>::hex_iterator
-MGDoFHandler<dim>::last_hex () const {
+MGDoFHandler<dim>::last_hex () const
+{
return last_hex (mg_levels.size()-1);
}
template <int dim>
typename MGDoFHandler<dim>::active_line_iterator
-MGDoFHandler<dim>::last_active_line () const {
+MGDoFHandler<dim>::last_active_line () const
+{
return last_active_line (mg_levels.size()-1);
}
template <int dim>
typename MGDoFHandler<dim>::active_quad_iterator
-MGDoFHandler<dim>::last_active_quad () const {
+MGDoFHandler<dim>::last_active_quad () const
+{
return last_active_quad (mg_levels.size()-1);
}
template <int dim>
typename MGDoFHandler<dim>::active_hex_iterator
-MGDoFHandler<dim>::last_active_hex () const {
+MGDoFHandler<dim>::last_active_hex () const
+{
return last_active_hex (mg_levels.size()-1);
}
const unsigned int offset)
{
// first distribute global dofs
- DoFHandler<dim>::distribute_dofs (fe, offset);
+ DoFHandler<dim>::distribute_dofs (fe);
// reserve space for the MG dof numbers
template <>
unsigned int
MGDoFHandler<1>::distribute_dofs_on_cell (cell_iterator &cell,
- unsigned int next_free_dof) {
+ unsigned int next_free_dof)
+{
// distribute dofs of vertices
if (this->selected_fe->dofs_per_vertex > 0)
mg_vertex_dofs[vertex].init (min_level[vertex],
max_level[vertex],
- this->selected_fe->dofs_per_vertex);
+ this->get_fe().dofs_per_vertex);
}
else
{
// by restricting from fine level.
for (; level_cell!=level_end; ++level_cell)
{
- DoFObjectAccessor<dim, dim>& global_cell = *level_cell;
+ DoFObjectAccessor<dim, dim, DoFHandler>& global_cell = *level_cell;
// get the dof numbers of
// this cell for the global
// and the level-wise
#include <grid/tria.h>
#include <dofs/dof_handler.h>
#include <dofs/dof_accessor.h>
+#include <dofs/hp_dof_handler.h>
#include <grid/tria_iterator.h>
#include <fe/fe.h>
#include <fe/fe_values.h>
+#include <fe/hp_fe_values.h>
#include <fe/mapping_q1.h>
+#include <fe/select_fe_values.h>
#ifdef HAVE_STD_STRINGSTREAM
# include <sstream>
-template <int dof_handler_dim, int patch_dim, int patch_space_dim>
-DataOut_DoFData<dof_handler_dim,patch_dim,patch_space_dim>::DataEntryBase::
+template <int dof_handler_dim, template <int> class DH,
+ int patch_dim, int patch_space_dim>
+DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::DataEntryBase::
DataEntryBase (const std::vector<std::string> &names)
:
names(names)
-template <int dof_handler_dim, int patch_dim, int patch_space_dim>
-DataOut_DoFData<dof_handler_dim,patch_dim,patch_space_dim>::
+template <int dof_handler_dim, template <int> class DH,
+ int patch_dim, int patch_space_dim>
+DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::DataEntryBase::
DataEntryBase::~DataEntryBase ()
{}
-template <int dof_handler_dim, int patch_dim, int patch_space_dim>
+template <int dof_handler_dim, template <int> class DH,
+ int patch_dim, int patch_space_dim>
template <typename VectorType>
-DataOut_DoFData<dof_handler_dim,patch_dim,patch_space_dim>::
+DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::
DataEntry<VectorType>::
DataEntry (const VectorType *data,
const std::vector<std::string> &names)
{}
-
-template <int dof_handler_dim, int patch_dim, int patch_space_dim>
+template <int dof_handler_dim, template <int> class DH,
+ int patch_dim, int patch_space_dim>
template <typename VectorType>
double
-DataOut_DoFData<dof_handler_dim,patch_dim,patch_space_dim>::
+DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::
DataEntry<VectorType>::
get_cell_data_value (const unsigned int cell_number) const
{
-template <int dof_handler_dim, int patch_dim, int patch_space_dim>
+template <int dof_handler_dim, template <int> class DH,
+ int patch_dim, int patch_space_dim>
template <typename VectorType>
void
-DataOut_DoFData<dof_handler_dim,patch_dim,patch_space_dim>::
+DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::
DataEntry<VectorType>::
get_function_values (const FEValuesBase<dof_handler_dim> &fe_patch_values,
std::vector<Vector<double> > &patch_values_system) const
-template <int dof_handler_dim, int patch_dim, int patch_space_dim>
+template <int dof_handler_dim, template <int> class DH,
+ int patch_dim, int patch_space_dim>
template <typename VectorType>
void
-DataOut_DoFData<dof_handler_dim,patch_dim,patch_space_dim>::
+DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::
DataEntry<VectorType>::
get_function_values (const FEValuesBase<dof_handler_dim> &fe_patch_values,
std::vector<double> &patch_values) const
-template <int dof_handler_dim, int patch_dim, int patch_space_dim>
+template <int dof_handler_dim, template <int> class DH,
+ int patch_dim, int patch_space_dim>
template <typename VectorType>
unsigned int
-DataOut_DoFData<dof_handler_dim,patch_dim,patch_space_dim>::
+DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::
DataEntry<VectorType>::memory_consumption () const
{
return (sizeof (vector) +
-template <int dof_handler_dim, int patch_dim, int patch_space_dim>
+template <int dof_handler_dim, template <int> class DH,
+ int patch_dim, int patch_space_dim>
template <typename VectorType>
void
-DataOut_DoFData<dof_handler_dim,patch_dim,patch_space_dim>::
+DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::
DataEntry<VectorType>::clear ()
{
vector = 0;
-
-template <int dof_handler_dim, int patch_dim, int patch_space_dim>
-DataOut_DoFData<dof_handler_dim,patch_dim,patch_space_dim>::DataOut_DoFData ()
- :
+template <int dof_handler_dim, template <int> class DH,
+ int patch_dim, int patch_space_dim>
+DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::DataOut_DoFData ()
+ :
dofs(0,typeid(*this).name())
{}
-template <int dof_handler_dim, int patch_dim, int patch_space_dim>
-DataOut_DoFData<dof_handler_dim,patch_dim,patch_space_dim>::~DataOut_DoFData ()
+template <int dof_handler_dim, template <int> class DH,
+ int patch_dim, int patch_space_dim>
+DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::~DataOut_DoFData ()
{
clear ();
}
-template <int dof_handler_dim, int patch_dim, int patch_space_dim>
+template <int dof_handler_dim, template <int> class DH,
+ int patch_dim, int patch_space_dim>
void
-DataOut_DoFData<dof_handler_dim,patch_dim,patch_space_dim>::
-attach_dof_handler (const DoFHandler<dof_handler_dim> &d)
+DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::
+attach_dof_handler (const DH<dof_handler_dim> &d)
{
Assert (dof_data.size() == 0, ExcOldDataStillPresent());
Assert (cell_data.size() == 0, ExcOldDataStillPresent());
-template <int dof_handler_dim, int patch_dim, int patch_space_dim>
+template <int dof_handler_dim, template <int> class DH,
+ int patch_dim, int patch_space_dim>
template <class VECTOR>
void
-DataOut_DoFData<dof_handler_dim,patch_dim,patch_space_dim>::
+DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::
add_data_vector (const VECTOR &vec,
const std::vector<std::string> &names,
const DataVectorType type)
}
-template <int dof_handler_dim, int patch_dim, int patch_space_dim>
+
+template <int dof_handler_dim, template <int> class DH,
+ int patch_dim, int patch_space_dim>
template <class VECTOR>
void
-DataOut_DoFData<dof_handler_dim,patch_dim,patch_space_dim>::
+DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::
add_data_vector (const VECTOR &vec,
const std::string &name,
const DataVectorType type)
-template <int dof_handler_dim, int patch_dim, int patch_space_dim>
-void DataOut_DoFData<dof_handler_dim,patch_dim,patch_space_dim>::clear_data_vectors ()
+template <int dof_handler_dim, template <int> class DH,
+ int patch_dim, int patch_space_dim>
+void DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::clear_data_vectors ()
{
dof_data.erase (dof_data.begin(), dof_data.end());
cell_data.erase (cell_data.begin(), cell_data.end());
-template <int dof_handler_dim, int patch_dim, int patch_space_dim>
+template <int dof_handler_dim, template <int> class DH,
+ int patch_dim, int patch_space_dim>
void
-DataOut_DoFData<dof_handler_dim,patch_dim,patch_space_dim>::
+DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::
clear_input_data_references ()
{
for (unsigned int i=0; i<dof_data.size(); ++i)
-template <int dof_handler_dim, int patch_dim, int patch_space_dim>
+template <int dof_handler_dim, template <int> class DH,
+ int patch_dim, int patch_space_dim>
void
-DataOut_DoFData<dof_handler_dim,patch_dim,patch_space_dim>::clear ()
+DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::clear ()
{
dof_data.erase (dof_data.begin(), dof_data.end());
cell_data.erase (cell_data.begin(), cell_data.end());
-template <int dof_handler_dim, int patch_dim, int patch_space_dim>
+template <int dof_handler_dim, template <int> class DH,
+ int patch_dim, int patch_space_dim>
std::vector<std::string>
-DataOut_DoFData<dof_handler_dim,patch_dim,patch_space_dim>::
+DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::
get_dataset_names () const
{
std::vector<std::string> names;
-template <int dof_handler_dim, int patch_dim, int patch_space_dim>
+template <int dof_handler_dim, template <int> class DH,
+ int patch_dim, int patch_space_dim>
const std::vector< ::DataOutBase::Patch<patch_dim, patch_space_dim> > &
-DataOut_DoFData<dof_handler_dim,patch_dim,patch_space_dim>::get_patches () const
+DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::get_patches () const
{
return patches;
}
-template <int dof_handler_dim, int patch_dim, int patch_space_dim>
+template <int dof_handler_dim, template <int> class DH,
+ int patch_dim, int patch_space_dim>
unsigned int
-DataOut_DoFData<dof_handler_dim,patch_dim,patch_space_dim>::memory_consumption () const
+DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::memory_consumption () const
{
return (DataOutInterface<patch_dim,patch_space_dim>::memory_consumption () +
MemoryConsumption::memory_consumption (dofs) +
-template <int dim>
-void DataOut<dim>::build_some_patches (Data data)
+template <int dim, template <int> class DH>
+void DataOut<dim,DH>::build_some_patches (Data data)
{
QTrapez<1> q_trapez;
QIterated<dim> patch_points (q_trapez, data.n_subdivisions);
// we don't support anything else
// as well
static const MappingQ1<dim> mapping;
- FEValues<dim> fe_patch_values (mapping, this->dofs->get_fe(),
- patch_points, update_values);
+ typename SelectFEValues<DH<dim> >::FEValues
+ x_fe_patch_values (mapping, this->dofs->get_fe(),
+ patch_points, update_values);
const unsigned int n_q_points = patch_points.n_quadrature_points;
typename std::vector< ::DataOutBase::Patch<dim> >::iterator patch = this->patches.begin();
- typename DoFHandler<dim>::cell_iterator cell = first_cell();
+ cell_iterator cell=first_cell();
// get first cell in this thread
for (unsigned int i=0; (i<data.this_thread)&&(cell != this->dofs->end()); ++i)
if (data.n_datasets > 0)
{
- fe_patch_values.reinit (cell);
+ x_fe_patch_values.reinit (cell);
+ const FEValues<dim> &fe_patch_values
+ = x_fe_patch_values.get_present_fe_values ();
// first fill dof_data
for (unsigned int dataset=0; dataset<this->dof_data.size(); ++dataset)
//TODO: This introduces a quadratic component into the algorithm. We may be doing better if we always kept track of the cell_number when 'cell' is increased, but we have to make sure that we only do this if cell_number is actually used, since we don't want to enforce the activeness constraints otherwise
const unsigned int cell_number
= std::distance (this->dofs->begin_active(),
- typename DoFHandler<dim>::active_cell_iterator(cell));
+ active_cell_iterator (cell));
for (unsigned int dataset=0; dataset<this->cell_data.size(); ++dataset)
{
}
}
- // now fill the neighbors fields
+
for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
{
// let's look up whether
(cell->neighbor(f)->level() != cell->level()))
continue;
- const typename DoFHandler<dim>::cell_iterator
- neighbor = cell->neighbor(f);
+ const cell_iterator neighbor = cell->neighbor(f);
Assert (static_cast<unsigned int>(neighbor->level()) <
data.cell_to_patch_index_map->size(),
ExcInternalError());
}
-template <int dim>
-void DataOut<dim>::build_patches (const unsigned int n_subdivisions,
- const unsigned int n_threads_)
+
+template <int dim, template <int> class DH>
+void DataOut<dim,DH>::build_patches (const unsigned int n_subdivisions,
+ const unsigned int n_threads_)
{
static const MappingQ1<dim> mapping;
build_patches (mapping, n_subdivisions, n_threads_);
}
-template <int dim>
-void DataOut<dim>::build_patches (const Mapping<dim> &mapping,
- const unsigned int n_subdivisions,
- const unsigned int n_threads_)
+template <int dim, template <int> class DH>
+void DataOut<dim,DH>::build_patches (const Mapping<dim> &mapping,
+ const unsigned int n_subdivisions,
+ const unsigned int n_threads_)
{
Assert (n_subdivisions >= 1,
ExcInvalidNumberOfSubdivisions(n_subdivisions));
- typedef DataOut_DoFData<dim,dim> BaseClass;
+ typedef DataOut_DoFData<dim,DH,dim> BaseClass;
Assert (this->dofs != 0, typename BaseClass::ExcNoDoFHandlerSelected());
const unsigned int n_threads = (DEAL_II_USE_MT ? n_threads_ : 1);
for (unsigned int l=0; l<this->dofs->get_tria().n_levels(); ++l)
{
unsigned int max_index = 0;
- for (typename DoFHandler<dim>::cell_iterator cell=first_cell();
- cell != this->dofs->end();
+ for (cell_iterator cell=first_cell(); cell != this->dofs->end();
cell = next_cell(cell))
if (static_cast<unsigned int>(cell->level()) == l)
max_index = std::max (max_index,
};
unsigned int n_patches = 0;
- for (typename DoFHandler<dim>::cell_iterator cell=first_cell();
- cell != this->dofs->end();
+ for (cell_iterator cell=first_cell(); cell != this->dofs->end();
cell = next_cell(cell))
{
Assert (static_cast<unsigned int>(cell->level()) <
Threads::ThreadGroup<> threads;
for (unsigned int l=0; l<n_threads; ++l)
- threads += Threads::spawn (*this, &DataOut<dim>::build_some_patches)(thread_data[l]);
+ threads += Threads::spawn (*this, &DataOut<dim,DH>::build_some_patches)(thread_data[l]);
threads.join_all();
}
-template <int dim>
-typename DoFHandler<dim>::cell_iterator
-DataOut<dim>::first_cell ()
+
+template <int dim, template <int> class DH>
+typename DataOut<dim,DH>::cell_iterator
+DataOut<dim,DH>::first_cell ()
{
return this->dofs->begin_active ();
}
-template <int dim>
-typename DoFHandler<dim>::cell_iterator
-DataOut<dim>::next_cell (const typename DoFHandler<dim>::cell_iterator &cell)
+
+template <int dim, template <int> class DH>
+typename DataOut<dim,DH>::cell_iterator
+DataOut<dim,DH>::next_cell (const typename DataOut<dim,DH>::cell_iterator &cell)
{
// convert the iterator to an
// active_iterator and advance
// this to the next active cell
- typename DoFHandler<dim>::active_cell_iterator active_cell = cell;
+ typename DH<dim>::active_cell_iterator active_cell = cell;
++active_cell;
return active_cell;
}
-// explicit instantiations
-template class DataOut_DoFData<deal_II_dimension,deal_II_dimension>;
-
-template void
-DataOut_DoFData<deal_II_dimension,deal_II_dimension>::
-add_data_vector<Vector<double> > (
- const Vector<double> &vec,
- const std::vector<std::string> &name,
- const DataVectorType type);
-
-template void
-DataOut_DoFData<deal_II_dimension,deal_II_dimension>::
-add_data_vector<BlockVector<double> > (
- const BlockVector<double> &vec,
- const std::vector<std::string> &name,
- const DataVectorType type);
-
-#ifdef DEAL_II_USE_PETSC
-template void
-DataOut_DoFData<deal_II_dimension,deal_II_dimension>::
-add_data_vector<PETScWrappers::Vector> (
- const PETScWrappers::Vector &vec,
- const std::vector<std::string> &name,
- const DataVectorType type);
-
-template void
-DataOut_DoFData<deal_II_dimension,deal_II_dimension>::
-add_data_vector<PETScWrappers::BlockVector> (
- const PETScWrappers::BlockVector &vec,
- const std::vector<std::string> &name,
- const DataVectorType type);
-#endif
-
-template void
-DataOut_DoFData<deal_II_dimension,deal_II_dimension>::
-add_data_vector<Vector<double> > (
- const Vector<double> &vec,
- const std::string &name,
- const DataVectorType type);
-
-template void
-DataOut_DoFData<deal_II_dimension,deal_II_dimension>::
-add_data_vector<BlockVector<double> > (
- const BlockVector<double> &vec,
- const std::string &name,
- const DataVectorType type);
-
-#ifdef DEAL_II_USE_PETSC
-template void
-DataOut_DoFData<deal_II_dimension,deal_II_dimension>::
-add_data_vector<PETScWrappers::Vector> (
- const PETScWrappers::Vector &vec,
- const std::string &name,
- const DataVectorType type);
-
-template void
-DataOut_DoFData<deal_II_dimension,deal_II_dimension>::
-add_data_vector<PETScWrappers::BlockVector> (
- const PETScWrappers::BlockVector &vec,
- const std::string &name,
- const DataVectorType type);
+// explicit instantiations
+
+#define INSTANTIATE(D1,DH,D2,D3,V) \
+template void \
+DataOut_DoFData<D1,DH,D2,D3>:: \
+add_data_vector<V > (const V &, \
+ const std::string &, \
+ const DataVectorType); \
+\
+template void \
+DataOut_DoFData<D1,DH,D2,D3>:: \
+add_data_vector<V > (const V &, \
+ const std::vector<std::string> &, \
+ const DataVectorType)
+
+#ifndef DEAL_II_USE_PETSC
+# define INSTANTIATE_VECTORS(D1,DH,D2,D3) \
+ INSTANTIATE(D1,DH,D2,D3,Vector<double>); \
+ INSTANTIATE(D1,DH,D2,D3,Vector<float>); \
+ INSTANTIATE(D1,DH,D2,D3,BlockVector<double>) ; \
+ INSTANTIATE(D1,DH,D2,D3,BlockVector<float>)
+#else
+# define INSTANTIATE_VECTORS(D1,DH,D2,D3) \
+ INSTANTIATE(D1,DH,D2,D3,Vector<double>); \
+ INSTANTIATE(D1,DH,D2,D3,Vector<float>); \
+ INSTANTIATE(D1,DH,D2,D3,BlockVector<double>) ; \
+ INSTANTIATE(D1,DH,D2,D3,BlockVector<float>); \
+ INSTANTIATE(D1,DH,D2,D3,PETScWrappers::Vector); \
+ INSTANTIATE(D1,DH,D2,D3,PETScWrappers::BlockVector)
#endif
+// now do actual instantiations, first for DoFHandler...
+template class DataOut_DoFData<deal_II_dimension,DoFHandler,deal_II_dimension>;
+template class DataOut_DoFData<deal_II_dimension,DoFHandler,deal_II_dimension+1>;
+INSTANTIATE_VECTORS(deal_II_dimension,DoFHandler,deal_II_dimension,deal_II_dimension);
+INSTANTIATE_VECTORS(deal_II_dimension,DoFHandler,deal_II_dimension+1,deal_II_dimension+1);
-
-template class DataOut_DoFData<deal_II_dimension,deal_II_dimension+1>;
-
-template void
-DataOut_DoFData<deal_II_dimension,deal_II_dimension+1>::
-add_data_vector<Vector<double> > (
- const Vector<double> &vec,
- const std::vector<std::string> &name,
- const DataVectorType type);
-
-template void
-DataOut_DoFData<deal_II_dimension,deal_II_dimension+1>::
-add_data_vector<BlockVector<double> > (
- const BlockVector<double> &vec,
- const std::vector<std::string> &name,
- const DataVectorType type);
-
-#ifdef DEAL_II_USE_PETSC
-template void
-DataOut_DoFData<deal_II_dimension,deal_II_dimension+1>::
-add_data_vector<PETScWrappers::Vector> (
- const PETScWrappers::Vector &vec,
- const std::vector<std::string> &name,
- const DataVectorType type);
-
-template void
-DataOut_DoFData<deal_II_dimension,deal_II_dimension+1>::
-add_data_vector<PETScWrappers::BlockVector> (
- const PETScWrappers::BlockVector &vec,
- const std::vector<std::string> &name,
- const DataVectorType type);
-#endif
-
-template void
-DataOut_DoFData<deal_II_dimension,deal_II_dimension+1>::
-add_data_vector<Vector<double> > (
- const Vector<double> &vec,
- const std::string &name,
- const DataVectorType type);
-
-template void
-DataOut_DoFData<deal_II_dimension,deal_II_dimension+1>::
-add_data_vector<BlockVector<double> > (
- const BlockVector<double> &vec,
- const std::string &name,
- const DataVectorType type);
-
-#ifdef DEAL_II_USE_PETSC
-template void
-DataOut_DoFData<deal_II_dimension,deal_II_dimension+1>::
-add_data_vector<PETScWrappers::Vector> (
- const PETScWrappers::Vector &vec,
- const std::string &name,
- const DataVectorType type);
-
-template void
-DataOut_DoFData<deal_II_dimension,deal_II_dimension+1>::
-add_data_vector<PETScWrappers::BlockVector> (
- const PETScWrappers::BlockVector &vec,
- const std::string &name,
- const DataVectorType type);
+// for 3d, also generate an extra class
+#if deal_II_dimension >= 2
+template class DataOut_DoFData<deal_II_dimension,DoFHandler,
+ deal_II_dimension-1,deal_II_dimension>;
+INSTANTIATE_VECTORS(deal_II_dimension,DoFHandler,deal_II_dimension-1,deal_II_dimension);
#endif
+template class DataOut<deal_II_dimension,DoFHandler>;
-template class DataOut<deal_II_dimension>;
+// ...and now for hpDoFHandler
+template class DataOut_DoFData<deal_II_dimension,hpDoFHandler,deal_II_dimension>;
+template class DataOut_DoFData<deal_II_dimension,hpDoFHandler,deal_II_dimension+1>;
+INSTANTIATE_VECTORS(deal_II_dimension,hpDoFHandler,deal_II_dimension,deal_II_dimension);
+INSTANTIATE_VECTORS(deal_II_dimension,hpDoFHandler,deal_II_dimension+1,deal_II_dimension+1);
-
-// for 3d, also generate an extra class
#if deal_II_dimension >= 2
-template class DataOut_DoFData<deal_II_dimension,deal_II_dimension-1,deal_II_dimension>;
-
-template void
-DataOut_DoFData<deal_II_dimension,deal_II_dimension-1,deal_II_dimension>::
-add_data_vector<Vector<double> > (
- const Vector<double> &vec,
- const std::vector<std::string> &name,
- const DataVectorType type);
-
-template void
-DataOut_DoFData<deal_II_dimension,deal_II_dimension-1,deal_II_dimension>::
-add_data_vector<BlockVector<double> > (
- const BlockVector<double> &vec,
- const std::vector<std::string> &name,
- const DataVectorType type);
-
-#ifdef DEAL_II_USE_PETSC
-template void
-DataOut_DoFData<deal_II_dimension,deal_II_dimension-1,deal_II_dimension>::
-add_data_vector<PETScWrappers::Vector> (
- const PETScWrappers::Vector &vec,
- const std::vector<std::string> &name,
- const DataVectorType type);
-
-template void
-DataOut_DoFData<deal_II_dimension,deal_II_dimension-1,deal_II_dimension>::
-add_data_vector<PETScWrappers::BlockVector> (
- const PETScWrappers::BlockVector &vec,
- const std::vector<std::string> &name,
- const DataVectorType type);
+template class DataOut_DoFData<deal_II_dimension,hpDoFHandler,
+ deal_II_dimension-1,deal_II_dimension>;
+INSTANTIATE_VECTORS(deal_II_dimension,hpDoFHandler,deal_II_dimension-1,deal_II_dimension);
#endif
-template void
-DataOut_DoFData<deal_II_dimension,deal_II_dimension-1,deal_II_dimension>::
-add_data_vector<Vector<double> > (
- const Vector<double> &vec,
- const std::string &name,
- const DataVectorType type);
-
-template void
-DataOut_DoFData<deal_II_dimension,deal_II_dimension-1,deal_II_dimension>::
-add_data_vector<BlockVector<double> > (
- const BlockVector<double> &vec,
- const std::string &name,
- const DataVectorType type);
-
-#ifdef DEAL_II_USE_PETSC
-template void
-DataOut_DoFData<deal_II_dimension,deal_II_dimension-1,deal_II_dimension>::
-add_data_vector<PETScWrappers::Vector> (
- const PETScWrappers::Vector &vec,
- const std::string &name,
- const DataVectorType type);
-
-template void
-DataOut_DoFData<deal_II_dimension,deal_II_dimension-1,deal_II_dimension>::
-add_data_vector<PETScWrappers::BlockVector> (
- const PETScWrappers::BlockVector &vec,
- const std::string &name,
- const DataVectorType type);
-#endif
-
-#endif
+template class DataOut<deal_II_dimension,hpDoFHandler>;
#include <grid/tria_iterator.h>
#include <fe/fe.h>
#include <fe/fe_values.h>
+#include <fe/hp_fe_values.h>
+#include <fe/select_fe_values.h>
#include <fe/mapping_q1.h>
-template <int dim>
-void DataOutFaces<dim>::build_some_patches (Data data)
+template <int dim, template <int> class DH>
+void DataOutFaces<dim,DH>::build_some_patches (Data data)
{
QTrapez<1> q_trapez;
QIterated<dim-1> patch_points (q_trapez, data.n_subdivisions);
// we don't support anything else
// as well
static const MappingQ1<dim> mapping;
- FEFaceValues<dim> fe_patch_values (mapping, this->dofs->get_fe(),
- patch_points, update_values);
+ typename SelectFEValues<DH<dim> >::FEFaceValues
+ x_fe_patch_values (mapping, this->dofs->get_fe(),
+ patch_points, update_values);
const unsigned int n_q_points = patch_points.n_quadrature_points;
if (data.n_datasets > 0)
{
- fe_patch_values.reinit (face.first, face.second);
+ x_fe_patch_values.reinit (face.first, face.second);
+ const FEFaceValues<dim> &fe_patch_values
+ = x_fe_patch_values.get_present_fe_values ();
// first fill dof_data
for (unsigned int dataset=0; dataset<this->dof_data.size(); ++dataset)
Assert (face.first->active(), ExcCellNotActiveForCellData());
const unsigned int cell_number
= std::distance (this->dofs->begin_active(),
- typename DoFHandler<dim>::active_cell_iterator(face.first));
+ typename DH<dim>::active_cell_iterator(face.first));
const double value
= this->cell_data[dataset]->get_cell_data_value (cell_number);
-template <int dim>
-void DataOutFaces<dim>::build_patches (const unsigned int n_subdivisions,
- const unsigned int n_threads_)
+template <int dim, template <int> class DH>
+void DataOutFaces<dim,DH>::build_patches (const unsigned int n_subdivisions,
+ const unsigned int n_threads_)
{
Assert (n_subdivisions >= 1,
ExcInvalidNumberOfSubdivisions(n_subdivisions));
- typedef DataOut_DoFData<dim,dim+1> BaseClass;
+ typedef DataOut_DoFData<dim,DH,dim+1> BaseClass;
Assert (this->dofs != 0, typename BaseClass::ExcNoDoFHandlerSelected());
const unsigned int n_threads = (DEAL_II_USE_MT ? n_threads_ : 1);
{
Threads::ThreadGroup<> threads;
for (unsigned int l=0;l<n_threads;++l)
- threads += Threads::spawn (*this, &DataOutFaces<dim>::build_some_patches)(thread_data[l]);
+ threads += Threads::spawn (*this, &DataOutFaces<dim,DH>::build_some_patches)(thread_data[l]);
threads.join_all();
}
else
-template <int dim>
-typename DataOutFaces<dim>::FaceDescriptor
-DataOutFaces<dim>::first_face ()
+template <int dim, template <int> class DH>
+typename DataOutFaces<dim,DH>::FaceDescriptor
+DataOutFaces<dim,DH>::first_face ()
{
// simply find first active cell
// with a face on the boundary
- typename DoFHandler<dim>::active_cell_iterator cell = this->dofs->begin_active();
+ typename DH<dim>::active_cell_iterator cell = this->dofs->begin_active();
for (; cell != this->dofs->end(); ++cell)
for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
if (cell->face(f)->at_boundary())
-template <int dim>
-typename DataOutFaces<dim>::FaceDescriptor
-DataOutFaces<dim>::next_face (const FaceDescriptor &old_face)
+template <int dim, template <int> class DH>
+typename DataOutFaces<dim,DH>::FaceDescriptor
+DataOutFaces<dim,DH>::next_face (const FaceDescriptor &old_face)
{
FaceDescriptor face = old_face;
// convert the iterator to an
// active_iterator and advance
// this to the next active cell
- typename DoFHandler<dim>::active_cell_iterator active_cell = face.first;
+ typename DH<dim>::active_cell_iterator active_cell = face.first;
// increase face pointer by one
++active_cell;
// explicit instantiations
// don't instantiate anything for the 1d and 2d cases
#if deal_II_dimension >=2
-template class DataOutFaces<deal_II_dimension>;
+template class DataOutFaces<deal_II_dimension,DoFHandler>;
+template class DataOutFaces<deal_II_dimension,hpDoFHandler>;
#endif
#include <grid/tria_iterator.h>
#include <fe/fe.h>
#include <fe/fe_values.h>
+#include <fe/hp_fe_values.h>
+#include <fe/select_fe_values.h>
#include <fe/mapping_q1.h>
#include <numerics/data_out_rotation.h>
-template <int dim>
-void DataOutRotation<dim>::build_some_patches (Data data)
+template <int dim, template <int> class DH>
+void DataOutRotation<dim,DH>::build_some_patches (Data data)
{
QTrapez<1> q_trapez;
QIterated<dim> patch_points (q_trapez, data.n_subdivisions);
// we don't support anything else
// as well
static const MappingQ1<dim> mapping;
- FEValues<dim> fe_patch_values (mapping, this->dofs->get_fe(),
- patch_points, update_values);
+ typename SelectFEValues<DH<dim> >::FEValues
+ x_fe_patch_values (mapping, this->dofs->get_fe(),
+ patch_points, update_values);
const unsigned int n_patches_per_circle = data.n_patches_per_circle;
unsigned int cell_number = 0;
typename std::vector< ::DataOutBase::Patch<dim+1> >::iterator
patch = this->patches.begin();
- typename DoFHandler<dim>::cell_iterator cell=first_cell();
+ cell_iterator cell=first_cell();
// get first cell in this thread
for (unsigned int i=0; (i<data.this_thread)&&(cell != this->dofs->end()); ++i)
// then fill in data
if (data.n_datasets > 0)
{
- fe_patch_values.reinit (cell);
-
+ x_fe_patch_values.reinit (cell);
+ const FEValues<dim> &fe_patch_values
+ = x_fe_patch_values.get_present_fe_values ();
+
// first fill dof_data
for (unsigned int dataset=0; dataset<this->dof_data.size(); ++dataset)
{
#if deal_II_dimension == 3
template <>
-void DataOutRotation<3>::build_some_patches (Data)
+void DataOutRotation<3,DoFHandler>::build_some_patches (Data)
{
// would this function make any
// sense after all? who would want
-template <int dim>
-void DataOutRotation<dim>::build_patches (const unsigned int n_patches_per_circle,
- const unsigned int n_subdivisions,
- const unsigned int n_threads_)
+template <int dim, template <int> class DH>
+void DataOutRotation<dim,DH>::build_patches (const unsigned int n_patches_per_circle,
+ const unsigned int n_subdivisions,
+ const unsigned int n_threads_)
{
Assert (n_subdivisions >= 1,
ExcInvalidNumberOfSubdivisions(n_subdivisions));
- typedef DataOut_DoFData<dim,dim+1> BaseClass;
+ typedef DataOut_DoFData<dim,DH,dim+1> BaseClass;
Assert (this->dofs != 0, typename BaseClass::ExcNoDoFHandlerSelected());
const unsigned int n_threads = (DEAL_II_USE_MT ? n_threads_ : 1);
// create patches of and make sure
// there is enough memory for that
unsigned int n_patches = 0;
- for (typename DoFHandler<dim>::cell_iterator cell=first_cell();
- cell != this->dofs->end();
+ for (cell_iterator cell=first_cell(); cell != this->dofs->end();
cell = next_cell(cell))
++n_patches;
// then also take into account that
if (DEAL_II_USE_MT)
{
- void (DataOutRotation<dim>::*p) (Data)
- = &DataOutRotation<dim>::build_some_patches;
+ void (DataOutRotation<dim,DH>::*p) (Data)
+ = &DataOutRotation<dim,DH>::build_some_patches;
Threads::ThreadGroup<> threads;
for (unsigned int l=0;l<n_threads;++l)
-template <int dim>
-typename DoFHandler<dim>::cell_iterator
-DataOutRotation<dim>::first_cell ()
+template <int dim, template <int> class DH>
+typename DataOutRotation<dim,DH>::cell_iterator
+DataOutRotation<dim,DH>::first_cell ()
{
return this->dofs->begin_active ();
}
-template <int dim>
-typename DoFHandler<dim>::cell_iterator
-DataOutRotation<dim>::next_cell (const typename DoFHandler<dim>::cell_iterator &cell)
+template <int dim, template <int> class DH>
+typename DataOutRotation<dim,DH>::cell_iterator
+DataOutRotation<dim,DH>::next_cell (const cell_iterator &cell)
{
// convert the iterator to an
// active_iterator and advance
// this to the next active cell
- typename DoFHandler<dim>::active_cell_iterator active_cell = cell;
+ typename DH<dim>::active_cell_iterator active_cell = cell;
++active_cell;
return active_cell;
}
// explicit instantiations
-template class DataOutRotation<deal_II_dimension>;
+template class DataOutRotation<deal_II_dimension,DoFHandler>;
#include <grid/tria_iterator.h>
#include <fe/fe.h>
#include <fe/fe_values.h>
+#include <fe/hp_fe_values.h>
+#include <fe/select_fe_values.h>
#include <fe/mapping_q1.h>
#ifdef HAVE_STD_STRINGSTREAM
# include <strstream>
#endif
-
-template <int dim>
+template <int dim, template <int> class DH>
unsigned int
-DataOutStack<dim>::DataVector::memory_consumption () const
+DataOutStack<dim,DH>::DataVector::memory_consumption () const
{
return (MemoryConsumption::memory_consumption (data) +
MemoryConsumption::memory_consumption (names));
-template <int dim>
-DataOutStack<dim>::~DataOutStack ()
+template <int dim, template <int> class DH>
+DataOutStack<dim,DH>::~DataOutStack ()
{}
-template <int dim>
-void DataOutStack<dim>::new_parameter_value (const double p,
- const double dp)
+template <int dim, template <int> class DH>
+void DataOutStack<dim,DH>::new_parameter_value (const double p,
+ const double dp)
{
parameter = p;
parameter_step = dp;
}
-template <int dim>
-void DataOutStack<dim>::attach_dof_handler (const DoFHandler<dim> &dof)
+template <int dim, template <int> class DH>
+void DataOutStack<dim,DH>::attach_dof_handler (const DH<dim> &dof)
{
dof_handler = &dof;
}
-template <int dim>
-void DataOutStack<dim>::declare_data_vector (const std::string &name,
- const VectorType vector_type)
+template <int dim, template <int> class DH>
+void DataOutStack<dim,DH>::declare_data_vector (const std::string &name,
+ const VectorType vector_type)
{
std::vector<std::string> names;
names.push_back (name);
}
-template <int dim>
-void DataOutStack<dim>::declare_data_vector (const std::vector<std::string> &names,
- const VectorType vector_type)
+template <int dim, template <int> class DH>
+void DataOutStack<dim,DH>::declare_data_vector (const std::vector<std::string> &names,
+ const VectorType vector_type)
{
// make sure this function is
// not called after some parameter
}
-template <int dim>
+template <int dim, template <int> class DH>
template <typename number>
-void DataOutStack<dim>::add_data_vector (const Vector<number> &vec,
- const std::string &name)
+void DataOutStack<dim,DH>::add_data_vector (const Vector<number> &vec,
+ const std::string &name)
{
const unsigned int n_components = dof_handler->get_fe().n_components ();
}
-template <int dim>
+template <int dim, template <int> class DH>
template <typename number>
-void DataOutStack<dim>::add_data_vector (const Vector<number> &vec,
- const std::vector<std::string> &names)
+void DataOutStack<dim,DH>::add_data_vector (const Vector<number> &vec,
+ const std::vector<std::string> &names)
{
Assert (dof_handler != 0, ExcNoDoFHandlerSelected ());
// either cell data and one name,
}
-template <int dim>
-void DataOutStack<dim>::build_patches (const unsigned int n_subdivisions)
+template <int dim, template <int> class DH>
+void DataOutStack<dim,DH>::build_patches (const unsigned int n_subdivisions)
{
// this is mostly copied from the
// DataOut class
// create patches of and make sure
// there is enough memory for that
unsigned int n_patches = 0;
- for (typename DoFHandler<dim>::active_cell_iterator
+ for (typename DH<dim>::active_cell_iterator
cell=dof_handler->begin_active();
cell != dof_handler->end(); ++cell)
++n_patches;
// we don't support anything else
// as well
static const MappingQ1<dim> mapping;
- FEValues<dim> fe_patch_values (mapping, dof_handler->get_fe(),
- patch_points, update_values);
+ typename SelectFEValues<DH<dim> >::FEValues
+ x_fe_patch_values (mapping, dof_handler->get_fe(),
+ patch_points, update_values);
const unsigned int n_q_points = patch_points.n_quadrature_points;
std::vector<double> patch_values (n_q_points);
std::vector<Vector<double> > patch_values_system (n_q_points,
typename std::vector< ::DataOutBase::Patch<dim+1,dim+1> >::iterator
patch = patches.begin() + (patches.size()-n_patches);
unsigned int cell_number = 0;
- for (typename DoFHandler<dim>::active_cell_iterator cell=dof_handler->begin_active();
+ for (typename DH<dim>::active_cell_iterator cell=dof_handler->begin_active();
cell != dof_handler->end(); ++cell, ++patch, ++cell_number)
{
Assert (patch != patches.end(), ExcInternalError());
// in succession
if (n_datasets > 0)
{
- fe_patch_values.reinit (cell);
+ x_fe_patch_values.reinit (cell);
+ const FEValues<dim> &fe_patch_values
+ = x_fe_patch_values.get_present_fe_values ();
// first fill dof_data
for (unsigned int dataset=0; dataset<dof_data.size(); ++dataset)
}
-template <int dim>
-void DataOutStack<dim>::finish_parameter_value ()
+template <int dim, template <int> class DH>
+void DataOutStack<dim,DH>::finish_parameter_value ()
{
// release lock on dof handler
dof_handler = 0;
-template <int dim>
+template <int dim, template <int> class DH>
unsigned int
-DataOutStack<dim>::memory_consumption () const
+DataOutStack<dim,DH>::memory_consumption () const
{
return (DataOutInterface<dim+1>::memory_consumption () +
MemoryConsumption::memory_consumption (parameter) +
-template <int dim>
+template <int dim, template <int> class DH>
const std::vector< ::DataOutBase::Patch<dim+1,dim+1> > &
-DataOutStack<dim>::get_patches () const
+DataOutStack<dim,DH>::get_patches () const
{
return patches;
}
-template <int dim>
-std::vector<std::string> DataOutStack<dim>::get_dataset_names () const
+template <int dim, template <int> class DH>
+std::vector<std::string> DataOutStack<dim,DH>::get_dataset_names () const
{
std::vector<std::string> names;
for (typename std::vector<DataVector>::const_iterator dataset=dof_data.begin();
// explicit instantiations
-template class DataOutStack<deal_II_dimension>;
+template class DataOutStack<deal_II_dimension,DoFHandler>;
-template void DataOutStack<deal_II_dimension>::
+template void DataOutStack<deal_II_dimension,DoFHandler>::
add_data_vector<double> (const Vector<double> &vec,
const std::string &name);
-template void DataOutStack<deal_II_dimension>::
-add_data_vector<double> (const Vector<double> &vec,
- const std::vector<std::string> &names);
+template void DataOutStack<deal_II_dimension,DoFHandler>::
+add_data_vector<float> (const Vector<float> &vec,
+ const std::string &name);
-template void DataOutStack<deal_II_dimension>::
+template class DataOutStack<deal_II_dimension,hpDoFHandler>;
+template void DataOutStack<deal_II_dimension,hpDoFHandler>::
+add_data_vector<double> (const Vector<double> &vec,
+ const std::string &name);
+template void DataOutStack<deal_II_dimension,hpDoFHandler>::
add_data_vector<float> (const Vector<float> &vec,
const std::string &name);
#include <dofs/dof_handler.h>
#include <fe/fe.h>
#include <fe/fe_values.h>
+#include <fe/hp_fe_values.h>
+#include <fe/select_fe_values.h>
#include <fe/mapping_q1.h>
#include <numerics/derivative_approximation.h>
double EE[3] = { 0, 0, 0 };
// the eigenvalues are away from
// @p{am} in the order of R. thus,
- // if R<<AM, then we have
+ // if R<<AM, then we have the
// degenerate case with three
// identical eigenvalues. check
// this first
- if (R < 1e-14*std::fabs(am))
+ if (R <= 1e-14*std::fabs(am))
EE[0] = EE[1] = EE[2] = am;
else
{
-template <int dim, class InputVector>
+template <int dim, template <int> class DH, class InputVector>
void
DerivativeApproximation::
approximate_gradient (const Mapping<dim> &mapping,
- const DoFHandler<dim> &dof_handler,
+ const DH<dim> &dof_handler,
const InputVector &solution,
Vector<float> &derivative_norm,
const unsigned int component)
{
approximate_derivative<Gradient<dim>,dim> (mapping,
- dof_handler,
- solution,
- component,
- derivative_norm);
+ dof_handler,
+ solution,
+ component,
+ derivative_norm);
}
-template <int dim, class InputVector>
+template <int dim, template <int> class DH, class InputVector>
void
DerivativeApproximation::
-approximate_gradient (const DoFHandler<dim> &dof_handler,
+approximate_gradient (const DH<dim> &dof_handler,
const InputVector &solution,
Vector<float> &derivative_norm,
const unsigned int component)
Assert (DEAL_II_COMPAT_MAPPING, ExcCompatibility("mapping"));
static const MappingQ1<dim> mapping;
approximate_derivative<Gradient<dim>,dim> (mapping,
- dof_handler,
- solution,
- component,
- derivative_norm);
+ dof_handler,
+ solution,
+ component,
+ derivative_norm);
}
-template <int dim, class InputVector>
+template <int dim, template <int> class DH, class InputVector>
void
DerivativeApproximation::
approximate_second_derivative (const Mapping<dim> &mapping,
- const DoFHandler<dim> &dof_handler,
+ const DH<dim> &dof_handler,
const InputVector &solution,
Vector<float> &derivative_norm,
const unsigned int component)
}
-template <int dim, class InputVector>
+template <int dim, template <int> class DH, class InputVector>
void
DerivativeApproximation::
-approximate_second_derivative (const DoFHandler<dim> &dof_handler,
+approximate_second_derivative (const DH<dim> &dof_handler,
const InputVector &solution,
Vector<float> &derivative_norm,
const unsigned int component)
}
-template <class DerivativeDescription, int dim, class InputVector>
+namespace WorkAround
+{
+// gcc 2.95 is not happy if we take the address of a template function as in
+//
+// DerivativeApproximation::template approximate<DerivativeDescription,dim,DH>
+//
+// if one of the template arguments is a template-template
+// parameter. so work around this problem in a rather unnerving and
+// weird way, but at least it works
+ template <template <int> class DH> struct IsHP
+ {
+ static const bool value = false;
+ };
+ template <template <int> class DH> const bool IsHP<DH>::value;
+
+ template <> struct IsHP<hpDoFHandler>
+ {
+ static const bool value = true;
+ };
+ const bool IsHP<hpDoFHandler>::value;
+}
+
+
+
+template <class DerivativeDescription, int dim,
+ template <int> class DH, class InputVector>
void
DerivativeApproximation::
approximate_derivative (const Mapping<dim> &mapping,
- const DoFHandler<dim> &dof_handler,
+ const DH<dim> &dof_handler,
const InputVector &solution,
const unsigned int component,
Vector<float> &derivative_norm)
std::vector<IndexInterval> index_intervals
= Threads::split_interval (0, dof_handler.get_tria().n_active_cells(),
n_threads);
+
Threads::ThreadGroup<> threads;
- void (*fun_ptr) (const Mapping<dim> &,
- const DoFHandler<dim> &,
- const InputVector &,
- const unsigned int ,
- const IndexInterval &,
- Vector<float> &)
- = &DerivativeApproximation::template approximate<DerivativeDescription,dim,InputVector>;
+
+ typedef void (*FunPtr) (const Mapping<dim> &,
+ const DH<dim> &,
+ const InputVector &,
+ const unsigned int ,
+ const IndexInterval &,
+ Vector<float> &);
+
+#ifdef DEAL_II_FUNPTR_TEMPLATE_TEMPLATE_BUG
+ const FunPtr fun_ptr
+ = (WorkAround::IsHP<DH>::value ?
+ &DerivativeApproximation::template approximate<DerivativeDescription,dim,hpDoFHandler,InputVector> :
+ &DerivativeApproximation::template approximate<DerivativeDescription,dim,DoFHandler,InputVector>);
+#else
+ const FunPtr fun_ptr
+ = &DerivativeApproximation::template approximate<DerivativeDescription,dim,DH,InputVector>;
+#endif
for (unsigned int i=0; i<n_threads; ++i)
threads += Threads::spawn (fun_ptr)(mapping, dof_handler, solution, component,
index_intervals[i],
-template <class DerivativeDescription, int dim, class InputVector>
+template <class DerivativeDescription, int dim,
+ template <int> class DH, class InputVector>
void
DerivativeApproximation::approximate (const Mapping<dim> &mapping,
- const DoFHandler<dim> &dof_handler,
+ const DH<dim> &dof_handler,
const InputVector &solution,
const unsigned int component,
const IndexInterval &index_interval,
Vector<float> &derivative_norm)
{
QMidpoint<dim> midpoint_rule;
- FEValues<dim> fe_midpoint_value (mapping, dof_handler.get_fe(),
- midpoint_rule,
- UpdateFlags(DerivativeDescription::update_flags |
- update_q_points));
+ typename SelectFEValues<DH<dim> >::FEValues
+ x_fe_midpoint_value (mapping, dof_handler.get_fe(),
+ midpoint_rule,
+ UpdateFlags(DerivativeDescription::update_flags |
+ update_q_points));
// matrix Y=sum_i y_i y_i^T
Tensor<2,dim> Y;
derivative_norm_on_this_cell
= derivative_norm.begin() + index_interval.first;
- typename DoFHandler<dim>::active_cell_iterator cell, endc;
+ typename DH<dim>::active_cell_iterator cell, endc;
cell = endc = dof_handler.begin_active();
// (static_cast to avoid warnings
// about unsigned always >=0)
- advance (cell, static_cast<int>(index_interval.first));
- advance (endc, static_cast<int>(index_interval.second));
+ std::advance (cell, static_cast<int>(index_interval.first));
+ std::advance (endc, static_cast<int>(index_interval.second));
// vector to hold iterators to all
// active neighbors of a cell
// reserve the maximal number of
// active neighbors
- std::vector<typename DoFHandler<dim>::active_cell_iterator> active_neighbors;
+ std::vector<typename DH<dim>::active_cell_iterator> active_neighbors;
active_neighbors.reserve (GeometryInfo<dim>::faces_per_cell *
GeometryInfo<dim>::subfaces_per_face);
typename DerivativeDescription::Derivative projected_derivative;
// reinit fe values object...
- fe_midpoint_value.reinit (cell);
+ x_fe_midpoint_value.reinit (cell);
+ const FEValues<dim> &fe_midpoint_value
+ = x_fe_midpoint_value.get_present_fe_values();
// ...and get the value of the
// projected derivative...
for (unsigned int n=0; n<GeometryInfo<dim>::faces_per_cell; ++n)
if (! cell->at_boundary(n))
{
- typename DoFHandler<dim>::cell_iterator
+ typename DH<dim>::cell_iterator
neighbor = cell->neighbor(n);
if (neighbor->active())
active_neighbors.push_back (neighbor);
// present cell
if (dim == 1)
{
- typename DoFHandler<dim>::cell_iterator
+ typename DH<dim>::cell_iterator
neighbor_child = neighbor;
while (neighbor_child->has_children())
neighbor_child = neighbor_child->child (n==0 ? 1 : 0);
// now loop over all active
// neighbors and collect the
// data we need
- typename std::vector<typename DoFHandler<dim>::active_cell_iterator>::const_iterator
+ typename std::vector<typename DH<dim>::active_cell_iterator>::const_iterator
neighbor_ptr = active_neighbors.begin();
for (; neighbor_ptr!=active_neighbors.end(); ++neighbor_ptr)
{
- const typename DoFHandler<dim>::active_cell_iterator
+ const typename DH<dim>::active_cell_iterator
neighbor = *neighbor_ptr;
// reinit fe values object...
- fe_midpoint_value.reinit (neighbor);
+ x_fe_midpoint_value.reinit (neighbor);
+ const FEValues<dim> &fe_midpoint_value
+ = x_fe_midpoint_value.get_present_fe_values();
// ...and get the value of the
// solution...
}
-
+// --------------------------------------------------------------------
// explicit instantiations
-#define INSTANTIATE(InputVector) \
+#define INSTANTIATE(InputVector,DH) \
template \
void \
DerivativeApproximation:: \
approximate_gradient<deal_II_dimension> \
(const Mapping<deal_II_dimension> &mapping, \
- const DoFHandler<deal_II_dimension> &dof_handler, \
+ const DH<deal_II_dimension> &dof_handler, \
const InputVector &solution, \
Vector<float> &derivative_norm, \
const unsigned int component); \
void \
DerivativeApproximation:: \
approximate_gradient<deal_II_dimension> \
-(const DoFHandler<deal_II_dimension> &dof_handler, \
+(const DH<deal_II_dimension> &dof_handler, \
const InputVector &solution, \
Vector<float> &derivative_norm, \
const unsigned int component); \
DerivativeApproximation:: \
approximate_second_derivative<deal_II_dimension> \
(const Mapping<deal_II_dimension> &mapping, \
- const DoFHandler<deal_II_dimension> &dof_handler, \
+ const DH<deal_II_dimension> &dof_handler, \
const InputVector &solution, \
Vector<float> &derivative_norm, \
const unsigned int component); \
void \
DerivativeApproximation:: \
approximate_second_derivative<deal_II_dimension> \
-(const DoFHandler<deal_II_dimension> &dof_handler, \
+(const DH<deal_II_dimension> &dof_handler, \
const InputVector &solution, \
Vector<float> &derivative_norm, \
const unsigned int component)
-INSTANTIATE(Vector<double>);
-INSTANTIATE(Vector<float>);
-INSTANTIATE(BlockVector<double>);
-INSTANTIATE(BlockVector<float>);
+INSTANTIATE(Vector<double>, DoFHandler);
+INSTANTIATE(Vector<float>, DoFHandler);
+INSTANTIATE(BlockVector<double>, DoFHandler);
+INSTANTIATE(BlockVector<float>, DoFHandler);
+
+INSTANTIATE(Vector<double>, hpDoFHandler);
+INSTANTIATE(Vector<float>, hpDoFHandler);
+INSTANTIATE(BlockVector<double>, hpDoFHandler);
+INSTANTIATE(BlockVector<float>, hpDoFHandler);
#ifdef DEAL_II_USE_PETSC
-INSTANTIATE(PETScWrappers::Vector);
-INSTANTIATE(PETScWrappers::BlockVector);
+INSTANTIATE(PETScWrappers::Vector, DoFHandler);
+INSTANTIATE(PETScWrappers::BlockVector, DoFHandler);
+
+INSTANTIATE(PETScWrappers::Vector, hpDoFHandler);
+INSTANTIATE(PETScWrappers::BlockVector, hpDoFHandler);
#endif
#include <base/function.h>
+#include <base/quadrature.h>
#include <base/thread_management.h>
#include <base/multithread_info.h>
+#include <grid/tria_iterator.h>
+#include <grid/geometry_info.h>
#include <dofs/dof_handler.h>
#include <dofs/dof_accessor.h>
+#include <dofs/dof_tools.h>
#include <grid/tria_iterator.h>
#include <base/geometry_info.h>
#include <base/quadrature.h>
}
// transfer everything into the
- // global object
- mutex.acquire ();
+ // global object. lock the
+ // matrix meanwhile
+ Threads::ThreadMutex::ScopedLock lock (mutex);
for (unsigned int i=0; i<dofs_per_cell; ++i)
for (unsigned int j=0; j<dofs_per_cell; ++j)
if ((n_components==1) ||
cell_matrix(i,j));
for (unsigned int i=0; i<dofs_per_cell; ++i)
rhs_vector(dof_indices[i]) += local_rhs(i);
- mutex.release ();
};
}
{
const FiniteElement<dim> &fe = dof.get_fe();
const unsigned int n_components = fe.n_components();
- const bool fe_is_system = (n_components != 1);
+ const bool fe_is_system = (n_components != 1);
- Assert (matrix.n() == dof.n_boundary_dofs(boundary_functions), ExcInternalError());
+ Assert (matrix.n() == dof.n_boundary_dofs(boundary_functions),
+ ExcInternalError());
Assert (matrix.n() == matrix.m(), ExcInternalError());
Assert (matrix.n() == rhs_vector.size(), ExcInternalError());
Assert (boundary_functions.size() != 0, ExcInternalError());
!=
dofs_on_face_vector.end());
-#ifdef DEBUG
// in debug mode: compute an element
// in the matrix which is
// guaranteed to belong to a boundary
// must be an element belonging to
// the boundary. we take the maximum
// diagonal entry.
+#ifdef DEBUG
double max_diag_entry = 0;
for (unsigned int i=0; i<dofs_per_cell; ++i)
if (std::fabs(cell_matrix(i,i)) > max_diag_entry)
max_diag_entry = std::fabs(cell_matrix(i,i));
#endif
- mutex.acquire ();
+ // lock the matrix
+ Threads::ThreadMutex::ScopedLock lock (mutex);
for (unsigned int i=0; i<dofs_per_cell; ++i)
for (unsigned int j=0; j<dofs_per_cell; ++j)
if (dof_is_on_face[i] && dof_is_on_face[j])
Assert (std::fabs(cell_vector(j)) <= 1e-10 * max_diag_entry,
ExcInternalError());
};
- mutex.release ();
};
}
}
// transfer everything into the
- // global object
- mutex.acquire ();
+ // global object. lock the
+ // matrix meanwhile
+ Threads::ThreadMutex::ScopedLock lock (mutex);
for (unsigned int i=0; i<dofs_per_cell; ++i)
for (unsigned int j=0; j<dofs_per_cell; ++j)
if ((n_components==1) ||
fe.system_to_component_index(j).first))
matrix.add (dof_indices[i], dof_indices[j],
cell_matrix(i,j));
- mutex.release ();
}
}
}
// transfer everything into the
- // global object
- mutex.acquire ();
+ // global object. lock the
+ // matrix meanwhile
+ Threads::ThreadMutex::ScopedLock lock (mutex);
for (unsigned int i=0; i<dofs_per_cell; ++i)
for (unsigned int j=0; j<dofs_per_cell; ++j)
if ((n_components==1) ||
cell_matrix(i,j));
for (unsigned int i=0; i<dofs_per_cell; ++i)
rhs_vector(dof_indices[i]) += local_rhs(i);
- mutex.release ();
};
}
//
//---------------------------------------------------------------------------
+#include <dofs/dof_handler.h>
+#include <dofs/hp_dof_handler.h>
+
+namespace
+{
+ // Functions for the DoFHandler
+ template <int dim>
+ unsigned int
+ max_dofs_per_cell (const DoFHandler<dim> &dh)
+ {
+ return dh.get_fe().dofs_per_cell;
+ }
+
+
+ template <int dim>
+ unsigned int
+ max_dofs_per_face (const DoFHandler<dim> &dh)
+ {
+ return dh.get_fe().dofs_per_face;
+ }
+
+
+ template <int dim>
+ unsigned int
+ get_n_components (const DoFHandler<dim> &dh)
+ {
+ return dh.get_fe().n_components();
+ }
+
+
+ // Functions for the hpDoFHandler
+ template <int dim>
+ unsigned int
+ max_dofs_per_cell (const hpDoFHandler<dim> &dh)
+ {
+ return dh.get_fe().max_dofs_per_cell ();
+ }
+
+
+ template <int dim>
+ unsigned int
+ max_dofs_per_face (const hpDoFHandler<dim> &dh)
+ {
+ return dh.get_fe().max_dofs_per_face ();
+ }
+
+
+
+ template <int dim>
+ unsigned int
+ get_n_components (const hpDoFHandler<dim> &dh)
+ {
+ return dh.get_fe().n_components();
+ }
+}
+
+
#include<numerics/vectors.templates.h>
// explicit instantiations
std::map<unsigned int,double> &);
+
+// Due to introducing the DoFHandler as a template parameter,
+// the following instantiations are required in 1d
+#if deal_II_dimension == 1
+template
+void VectorTools::interpolate_boundary_values<deal_II_dimension>
+(const Mapping<1> &,
+ const DoFHandler<1> &,
+ const unsigned char,
+ const Function<1> &,
+ std::map<unsigned int,double> &,
+ const std::vector<bool> &);
+#endif
+
// the following two functions are not derived from a template in 1d
// and thus need no explicit instantiation
#if deal_II_dimension > 1