+/**
+ * Common template for line, quad, hex.
+ */
+template<int celldim, int dim, typename BaseClass>
+class DoFObjectAccessor;
+
+
* Unfortunately, we would run into problems, if we wanted a #DoFLineAccessor#
* in one spatial dimension, in which case a line is also a cell. The traditional
* solution would be to declare a #DoFCellAccessor<1># which is derived from
- * #DoFLineAccessor<1># and #CellAccessor<1># (the #DoFLineAccessor<dim># cannot
+ * #DoFObjectAccessor<1, 1># and #CellAccessor<1># (the #DoFObjectAccessor<1, dim># cannot
* itself be derived from #CellAccessor<dim># since a line is not a cell
* unless in one space dimension), but since a #DoFLineAccessor# and a
* #CellAccessor# are both derived from #TriaAccessor#, we would have to make
* pass a second template parameter to a #DoFLineAccessor# which tells it
* which class to be derived from: if we are in one spatial dimension, the
* base class is to be #CellAccessor<1>#, in two or more dimensions it
- * is a #LineAccessor<dim>#, i.e. am accessor to lines without the missing
+ * is a #TriaObjectAccessor<1, dim>#, i.e. am accessor to lines without the missing
* functionality needed for cells (neighbors, etc.).
*
* This way we can declare a #DoFCellAccessor# in one dimension by deriving
- * from #DoFLineAccessor<1,CellAccessor<1> >#, thus getting the cell
+ * from #DoFObjectAccessor<1, 1,CellAccessor<1> >#, thus getting the cell
* functionality through the #DoFLineAccessor# instead of through a virtual
* multiple inheritance of #DoFLineAccessor# and #CellAccessor<1>#.
*
* @author Wolfgang Bangerth, 1998
*/
template <int dim, typename BaseClass>
-class DoFLineAccessor : public DoFAccessor<dim>, public BaseClass {
+class DoFObjectAccessor<1, dim, BaseClass> : public DoFAccessor<dim>,
+ public BaseClass
+{
public:
/**
* Declare the data type that this accessor
* Default constructor, unused thus
* not implemented.
*/
- DoFLineAccessor ();
+ DoFObjectAccessor ();
/**
* Constructor. The #local_data#
* argument is assumed to be a pointer
* to a #DoFHandler<dim># object.
*/
- DoFLineAccessor (Triangulation<dim> *tria,
+ DoFObjectAccessor (Triangulation<dim> *tria,
const int level,
const int index,
const AccessorData *local_data) :
* class returns a line accessor without
* access to the DoF data.
*/
- TriaIterator<dim,DoFLineAccessor<dim,BaseClass> > child (const unsigned int) const;
+ TriaIterator<dim,DoFObjectAccessor<1, dim,BaseClass> > child (const unsigned int) const;
/**
* Distribute a local (cell based) vector
* Implement the copy operator needed
* for the iterator classes.
*/
- void copy_from (const DoFLineAccessor<dim,BaseClass> &a);
+ void copy_from (const DoFObjectAccessor<1, dim,BaseClass> &a);
};
-
-
-
/**
* Grant access to the degrees of freedom located on quads.
*
* @see DoFLineAccessor
*/
template <int dim, typename BaseClass>
-class DoFQuadAccessor : public DoFAccessor<dim>, public BaseClass {
+class DoFObjectAccessor<2, dim, BaseClass> : public DoFAccessor<dim>,
+ public BaseClass
+{
public:
/**
* Declare the data type that this accessor
* Default constructor, unused thus
* not implemented.
*/
- DoFQuadAccessor ();
+ DoFObjectAccessor ();
/**
* Constructor. The #local_data#
* argument is assumed to be a pointer
* to a #DoFHandler<dim># object.
*/
- DoFQuadAccessor (Triangulation<dim> *tria,
+ DoFObjectAccessor (Triangulation<dim> *tria,
const int level,
const int index,
const AccessorData *local_data) :
* Return a pointer to the #i#th line
* bounding this #Quad#.
*/
- TriaIterator<dim,DoFLineAccessor<dim,LineAccessor<dim> > >
+ TriaIterator<dim,DoFObjectAccessor<1, dim,TriaObjectAccessor<1, dim> > >
line (const unsigned int i) const;
/**
* class returns a quad accessor without
* access to the DoF data.
*/
- TriaIterator<dim,DoFQuadAccessor<dim,BaseClass> > child (const unsigned int) const;
+ TriaIterator<dim,DoFObjectAccessor<2, dim, BaseClass> > child (const unsigned int) const;
/**
* Distribute a local (cell based) vector
* Implement the copy operator needed
* for the iterator classes.
*/
- void copy_from (const DoFQuadAccessor<dim,BaseClass> &a);
+ void copy_from (const DoFObjectAccessor<2, dim,BaseClass> &a);
};
* Return a pointer to the #i#th line
* bounding this #Hex#.
*/
- TriaIterator<dim,DoFLineAccessor<dim,LineAccessor<dim> > >
+ TriaIterator<dim,DoFObjectAccessor<1, dim,TriaObjectAccessor<1, dim> > >
line (const unsigned int i) const;
/**
* Return a pointer to the #i#th quad
* bounding this #Hex#.
*/
- TriaIterator<dim,DoFQuadAccessor<dim,QuadAccessor<dim> > >
+ TriaIterator<dim,DoFObjectAccessor<2, dim,TriaObjectAccessor<2, dim> > >
quad (const unsigned int i) const;
/**
* with template parameters. This class and #DoFSubstructAccessor<2>#
* wrap the following names:
* \begin{verbatim}
- * DoFSubstructAccessor<1> := DoFLineAccessor<1,CellAccessor<1> >;
- * DoFSubstructAccessor<2> := DoFQuadAccessor<2,CellAccessor<2> >;
+ * DoFSubstructAccessor<1> := DoFObjectAccessor<1, 1,CellAccessor<1> >;
+ * DoFSubstructAccessor<2> := DoFObjectAccessor<2, 2,CellAccessor<2> >;
* \end{verbatim}
* We do this rather complex (and needless, provided C++ the needed constructs!)
* class hierarchy manipulation, since this way we can declare and implement
* the \Ref{DoFCellAccessor} dimension independent as an inheritance from
* #DoFSubstructAccessor<dim>#. If we had not declared these
* types, we would have to write two class declarations, one for
- * #DoFCellAccessor<1>#, derived from #DoFLineAccessor<1,CellAccessor<1> >#
+ * #DoFCellAccessor<1>#, derived from #DoFObjectAccessor<1, 1,CellAccessor<1> >#
* and one for #DoFCellAccessor<2>#, derived from
- * #DoFQuadAccessor<2,CellAccessor<2> >#.
+ * #DoFObjectAccessor<2, 2,CellAccessor<2> >#.
*/
template <>
-class DoFSubstructAccessor<1> : public DoFLineAccessor<1,CellAccessor<1> > {
+class DoFSubstructAccessor<1> : public DoFObjectAccessor<1, 1,CellAccessor<1> > {
public:
/**
* Declare the data type that this accessor
* class expects to get passed from the
* iterator classes.
*/
- typedef DoFLineAccessor<1,CellAccessor<1> >::AccessorData AccessorData;
+ typedef DoFObjectAccessor<1, 1,CellAccessor<1> >::AccessorData AccessorData;
/**
* Constructor
const int level,
const int index,
const AccessorData *local_data) :
- DoFLineAccessor<1,CellAccessor<1> > (tria,level,index,local_data) {};
+ DoFObjectAccessor<1, 1,CellAccessor<1> > (tria,level,index,local_data) {};
// do this here, since this way the
// CellAccessor has the possibility to know
// what a face_iterator is. Otherwise
* @see DoFSubstructAccessor<1>
*/
template <>
-class DoFSubstructAccessor<2> : public DoFQuadAccessor<2,CellAccessor<2> > {
+class DoFSubstructAccessor<2> : public DoFObjectAccessor<2, 2,CellAccessor<2> > {
public:
/**
* Declare the data type that this accessor
* class expects to get passed from the
* iterator classes.
*/
- typedef DoFQuadAccessor<2,CellAccessor<2> >::AccessorData AccessorData;
+ typedef DoFObjectAccessor<2, 2,CellAccessor<2> >::AccessorData AccessorData;
/**
* Constructor
const int level,
const int index,
const AccessorData *local_data) :
- DoFQuadAccessor<2,CellAccessor<2> > (tria,level,index,local_data) {};
+ DoFObjectAccessor<2, 2,CellAccessor<2> > (tria,level,index,local_data) {};
// do this here, since this way the
// CellAccessor has the possibility to know
// what a face_iterator is. Otherwise
// it would have to ask the DoFHandler<dim>
// which would need another big include
// file and maybe cyclic interdependence
- typedef TriaIterator<2,DoFLineAccessor<2,LineAccessor<2> > > face_iterator;
+ typedef TriaIterator<2,DoFObjectAccessor<1, 2,TriaObjectAccessor<1, 2> > > face_iterator;
};
* class expects to get passed from the
* iterator classes.
*/
- typedef DoFQuadAccessor<3,CellAccessor<3> >::AccessorData AccessorData;
+ typedef DoFObjectAccessor<2, 3,CellAccessor<3> >::AccessorData AccessorData;
/**
* Constructor
// it would have to ask the DoFHandler<dim>
// which would need another big include
// file and maybe cyclic interdependence
- typedef TriaIterator<3,DoFQuadAccessor<3,QuadAccessor<3> > > face_iterator;
+ typedef TriaIterator<3,DoFObjectAccessor<2, 3,TriaObjectAccessor<2, 3> > > face_iterator;
};
-
-
-
/**
* Grant access to the degrees of freedom on a cell. In fact, since all
* access to the degrees of freedom has been enabled by the classes
- * #DoFLineAccessor<1># and #DoFQuadAccessor<2># for the space dimension
+ * #DoFObjectAccessor<1, 1># and #DoFObjectAccessor<2, 2># for the space dimension
* one and two, respectively, this class only collects the pieces
* together by deriving from the appropriate #DoF*Accessor# and the
* right #CellAccessor<dim># and finally adding two functions which give
* of this cell.
*
* This function is not implemented in 1D,
- * and maps to DoFQuadAccessor::line in 2D.
+ * and maps to DoFObjectAccessor<2, dim>::line in 2D.
*/
typename DoFSubstructAccessor<dim>::face_iterator
face (const unsigned int i) const;
template <int dim, typename BaseClass>
inline
-int DoFLineAccessor<dim,BaseClass>::dof_index (const unsigned int i) const {
+int DoFObjectAccessor<1, dim,BaseClass>::dof_index (const unsigned int i) const {
Assert (dof_handler != 0, ExcInvalidObject());
// make sure a FE has been selected
// and enough room was reserved
template <int dim, typename BaseClass>
inline
-int DoFLineAccessor<dim,BaseClass>::vertex_dof_index (const unsigned int vertex,
+int DoFObjectAccessor<1, dim,BaseClass>::vertex_dof_index (const unsigned int vertex,
const unsigned int i) const {
Assert (dof_handler != 0, ExcInvalidObject());
Assert (dof_handler->selected_fe != 0, ExcInvalidObject());
template <int dim, typename BaseClass>
inline
void
-DoFLineAccessor<dim,BaseClass>::get_dof_indices (vector<int> &dof_indices) const {
+DoFObjectAccessor<1, dim,BaseClass>::get_dof_indices (vector<int> &dof_indices) const {
Assert (dof_handler != 0, ExcInvalidObject());
Assert (dof_handler->selected_fe != 0, ExcInvalidObject());
Assert (dof_indices.size() == (2*dof_handler->get_fe().dofs_per_vertex +
template <int dim, typename BaseClass>
inline
-TriaIterator<dim,DoFLineAccessor<dim,BaseClass> >
-DoFLineAccessor<dim,BaseClass>::child (const unsigned int i) const {
- TriaIterator<dim,DoFLineAccessor<dim,BaseClass> > q (tria,
+TriaIterator<dim,DoFObjectAccessor<1, dim,BaseClass> >
+DoFObjectAccessor<1, dim,BaseClass>::child (const unsigned int i) const {
+ TriaIterator<dim,DoFObjectAccessor<1, dim,BaseClass> > q (tria,
present_level+1,
child_index (i),
dof_handler);
template <int dim, typename BaseClass>
inline
void
-DoFLineAccessor<dim,BaseClass>::copy_from (const DoFLineAccessor<dim,BaseClass> &a) {
+DoFObjectAccessor<1, dim,BaseClass>::copy_from (const DoFObjectAccessor<1, dim,BaseClass> &a) {
BaseClass::copy_from (a);
set_dof_handler (a.dof_handler);
};
-/*------------------------- Functions: DoFQuadAccessor -----------------------*/
+/*------------------------- Functions: DoFObjectAccessor<2, dim> -----------------------*/
template <int dim, typename BaseClass>
inline
-int DoFQuadAccessor<dim,BaseClass>::dof_index (const unsigned int i) const {
+int DoFObjectAccessor<2, dim,BaseClass>::dof_index (const unsigned int i) const {
Assert (dof_handler != 0, ExcInvalidObject());
// make sure a FE has been selected
// and enough room was reserved
template <int dim, typename BaseClass>
inline
-int DoFQuadAccessor<dim,BaseClass>::vertex_dof_index (const unsigned int vertex,
+int DoFObjectAccessor<2, dim,BaseClass>::vertex_dof_index (const unsigned int vertex,
const unsigned int i) const {
Assert (dof_handler != 0, ExcInvalidObject());
Assert (dof_handler->selected_fe != 0, ExcInvalidObject());
template <int dim, typename BaseClass>
inline
void
-DoFQuadAccessor<dim,BaseClass>::get_dof_indices (vector<int> &dof_indices) const {
+DoFObjectAccessor<2, dim,BaseClass>::get_dof_indices (vector<int> &dof_indices) const {
Assert (dof_handler != 0, ExcInvalidObject());
Assert (dof_handler->selected_fe != 0, ExcInvalidObject());
Assert (dof_indices.size() == (4*dof_handler->get_fe().dofs_per_vertex +
template <int dim, typename BaseClass>
inline
-TriaIterator<dim,DoFLineAccessor<dim,LineAccessor<dim> > >
-DoFQuadAccessor<dim,BaseClass>::line (const unsigned int i) const {
+TriaIterator<dim,DoFObjectAccessor<1, dim,TriaObjectAccessor<1, dim> > >
+DoFObjectAccessor<2, dim,BaseClass>::line (const unsigned int i) const {
Assert (i<4, ExcIndexRange (i, 0, 4));
- return TriaIterator<dim,DoFLineAccessor<dim,LineAccessor<dim> > >
+ return TriaIterator<dim,DoFObjectAccessor<1, dim,TriaObjectAccessor<1, dim> > >
(
tria,
present_level,
template <int dim, typename BaseClass>
inline
-TriaIterator<dim,DoFQuadAccessor<dim,BaseClass> >
-DoFQuadAccessor<dim,BaseClass>::child (const unsigned int i) const {
- TriaIterator<dim,DoFQuadAccessor<dim,BaseClass> > q (tria,
+TriaIterator<dim,DoFObjectAccessor<2, dim,BaseClass> >
+DoFObjectAccessor<2, dim,BaseClass>::child (const unsigned int i) const {
+ TriaIterator<dim,DoFObjectAccessor<2, dim,BaseClass> > q (tria,
present_level+1,
child_index (i),
dof_handler);
template <int dim, typename BaseClass>
inline
void
-DoFQuadAccessor<dim,BaseClass>::copy_from (const DoFQuadAccessor<dim,BaseClass> &a) {
+DoFObjectAccessor<2, dim,BaseClass>::copy_from (const DoFObjectAccessor<2, dim,BaseClass> &a) {
BaseClass::copy_from (a);
set_dof_handler (a.dof_handler);
};
template <int dim, typename BaseClass>
inline
-TriaIterator<dim,DoFLineAccessor<dim,LineAccessor<dim> > >
+TriaIterator<dim,DoFObjectAccessor<1, dim,TriaObjectAccessor<1, dim> > >
DoFHexAccessor<dim,BaseClass>::line (const unsigned int i) const {
- TriaIterator<dim,LineAccessor<dim> > l = BaseClass::line(i);
- return TriaIterator<dim,DoFLineAccessor<dim,LineAccessor<dim> > >
+ TriaIterator<dim,TriaObjectAccessor<1, dim> > l = BaseClass::line(i);
+ return TriaIterator<dim,DoFObjectAccessor<1, dim,TriaObjectAccessor<1, dim> > >
(
tria,
present_level,
template <int dim, typename BaseClass>
inline
-TriaIterator<dim,DoFQuadAccessor<dim,QuadAccessor<dim> > >
+TriaIterator<dim,DoFObjectAccessor<2, dim,TriaObjectAccessor<2, dim> > >
DoFHexAccessor<dim,BaseClass>::quad (const unsigned int i) const {
Assert (i<6, ExcIndexRange (i, 0, 6));
- return TriaIterator<dim,DoFQuadAccessor<dim,QuadAccessor<dim> > >
+ return TriaIterator<dim,DoFObjectAccessor<2, dim,TriaObjectAccessor<2, dim> > >
(
tria,
present_level,
*/
class DoFDimensionInfo<2> {
public:
- typedef TriaRawIterator<2,DoFLineAccessor<2,LineAccessor<2> > > raw_line_iterator;
- typedef TriaIterator<2,DoFLineAccessor<2,LineAccessor<2> > > line_iterator;
- typedef TriaActiveIterator<2,DoFLineAccessor<2,LineAccessor<2> > > active_line_iterator;
+ typedef TriaRawIterator<2,DoFObjectAccessor<1, 2,TriaObjectAccessor<1, 2> > > raw_line_iterator;
+ typedef TriaIterator<2,DoFObjectAccessor<1, 2,TriaObjectAccessor<1, 2> > > line_iterator;
+ typedef TriaActiveIterator<2,DoFObjectAccessor<1, 2,TriaObjectAccessor<1, 2> > > active_line_iterator;
typedef TriaRawIterator<2,DoFCellAccessor<2> > raw_quad_iterator;
typedef TriaIterator<2,DoFCellAccessor<2> > quad_iterator;
*/
class DoFDimensionInfo<3> {
public:
- typedef TriaRawIterator<3,DoFLineAccessor<3,LineAccessor<3> > > raw_line_iterator;
- typedef TriaIterator<3,DoFLineAccessor<3,LineAccessor<3> > > line_iterator;
- typedef TriaActiveIterator<3,DoFLineAccessor<3,LineAccessor<3> > > active_line_iterator;
+ typedef TriaRawIterator<3,DoFObjectAccessor<1, 3,TriaObjectAccessor<1, 3> > > raw_line_iterator;
+ typedef TriaIterator<3,DoFObjectAccessor<1, 3,TriaObjectAccessor<1, 3> > > line_iterator;
+ typedef TriaActiveIterator<3,DoFObjectAccessor<1, 3,TriaObjectAccessor<1, 3> > > active_line_iterator;
- typedef TriaRawIterator<3,DoFQuadAccessor<3,QuadAccessor<3> > > raw_quad_iterator;
- typedef TriaIterator<3,DoFQuadAccessor<3,QuadAccessor<3> > > quad_iterator;
- typedef TriaActiveIterator<3,DoFQuadAccessor<3,QuadAccessor<3> > > active_quad_iterator;
+ typedef TriaRawIterator<3,DoFObjectAccessor<2, 3,TriaObjectAccessor<2, 3> > > raw_quad_iterator;
+ typedef TriaIterator<3,DoFObjectAccessor<2, 3,TriaObjectAccessor<2, 3> > > quad_iterator;
+ typedef TriaActiveIterator<3,DoFObjectAccessor<2, 3,TriaObjectAccessor<2, 3> > > active_quad_iterator;
typedef TriaRawIterator<3,DoFCellAccessor<3> > raw_hex_iterator;
typedef TriaIterator<3,DoFCellAccessor<3> > hex_iterator;
*/
/*@{*/
/**
- * Return iterator to the first cell, used
+ * Iterator to the first cell, used
* or not, on level #level#. If a level
* has no cells, a past-the-end iterator
* is returned.
raw_cell_iterator begin_raw (const unsigned int level = 0) const;
/**
- * Return iterator to the first used cell
+ * Iterator to the first used cell
* on level #level#.
*
* This function calls #begin_line#
cell_iterator begin (const unsigned int level = 0) const;
/**
- * Return iterator to the first active
+ * Iterator to the first active
* cell on level #level#.
*
* This function calls #begin_active_line#
active_cell_iterator begin_active(const unsigned int level = 0) const;
/**
- * Return iterator past the end; this
+ * Iterator past the end; this
* iterator serves for comparisons of
* iterators with past-the-end or
* before-the-beginning states.
*/
/*@{*/
/**
- * Return iterator to the first face, used
+ * Iterator to the first face, used
* or not, on level #level#. If a level
* has no faces, a past-the-end iterator
* is returned.
raw_face_iterator begin_raw_face (const unsigned int level = 0) const;
/**
- * Return iterator to the first used face
+ * Iterator to the first used face
* on level #level#.
*
* This function calls #begin_line#
face_iterator begin_face (const unsigned int level = 0) const;
/**
- * Return iterator to the first active
+ * Iterator to the first active
* face on level #level#.
*
* This function calls #begin_active_line#
active_face_iterator begin_active_face(const unsigned int level = 0) const;
/**
- * Return iterator past the end; this
+ * Iterator past the end; this
* iterator serves for comparisons of
* iterators with past-the-end or
* before-the-beginning states.
*/
/*@{*/
/**
- * Return iterator to the first line, used
+ * Iterator to the first line, used
* or not, on level #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;
/**
- * Return iterator to the first used line
+ * Iterator to the first used line
* on level #level#.
*/
line_iterator begin_line (const unsigned int level = 0) const;
/**
- * Return iterator to the first active
+ * Iterator to the first active
* line on level #level#.
*/
active_line_iterator begin_active_line(const unsigned int level = 0) const;
/**
- * Return iterator past the end; this
+ * Iterator past the end; this
* iterator serves for comparisons of
* iterators with past-the-end or
* before-the-beginning states.
/*@{
*/
/**
- * Return iterator to the first quad, used
+ * Iterator to the first quad, used
* or not, on level #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;
/**
- * Return iterator to the first used quad
+ * Iterator to the first used quad
* on level #level#.
*/
quad_iterator begin_quad (const unsigned int level = 0) const;
/**
- * Return iterator to the first active
+ * Iterator to the first active
* quad on level #level#.
*/
active_quad_iterator begin_active_quad(const unsigned int level = 0) const;
/**
- * Return iterator past the end; this
+ * Iterator past the end; this
* iterator serves for comparisons of
* iterators with past-the-end or
* before-the-beginning states.
/*@{
*/
/**
- * Return iterator to the first hex, used
+ * Iterator to the first hex, used
* or not, on level #level#. If a level
* has no hexs, a past-the-end iterator
* is returned.
begin_raw_hex (const unsigned int level = 0) const;
/**
- * Return iterator to the first used hex
+ * Iterator to the first used hex
* on level #level#.
*/
hex_iterator
begin_hex (const unsigned int level = 0) const;
/**
- * Return iterator to the first active
+ * Iterator to the first active
* hex on level #level#.
*/
active_hex_iterator
begin_active_hex(const unsigned int level = 0) const;
/**
- * Return iterator past the end; this
+ * Iterator past the end; this
* iterator serves for comparisons of
* iterators with past-the-end or
* before-the-beginning states.
vector<int> vertex_dofs;
- friend class DoFLineAccessor<dim, LineAccessor<dim> >;
- friend class DoFLineAccessor<dim, CellAccessor<dim> >;
- friend class DoFQuadAccessor<dim, QuadAccessor<dim> >;
- friend class DoFQuadAccessor<dim, CellAccessor<dim> >;
+ friend class DoFObjectAccessor<1, dim, TriaObjectAccessor<1, dim> >;
+ friend class DoFObjectAccessor<1, dim, CellAccessor<dim> >;
+ friend class DoFObjectAccessor<2, dim, TriaObjectAccessor<2, dim> >;
+ friend class DoFObjectAccessor<2, dim, CellAccessor<dim> >;
friend class DoFHexAccessor<dim, HexAccessor<dim> >;
friend class DoFHexAccessor<dim, CellAccessor<dim> >;
};
};
-
+template <int celldim, int dim, typename BaseClass>
+class MGDoFObjectAccessor;
/**
* Unfortunately, we would run into problems, if we wanted a #DoFLineAccessor#
* in one spatial dimension, in which case a line is also a cell. The traditional
* solution would be to declare a #DoFCellAccessor<1># which is derived from
- * #DoFLineAccessor<1># and #CellAccessor<1># (the #DoFLineAccessor<dim># cannot
+ * #DoFObjectAccessor<1, 1># and #CellAccessor<1># (the #DoFObjectAccessor<1, dim># cannot
* itself be derived from #CellAccessor<dim># since a line is not a cell
* unless in one space dimension), but since a #DoFLineAccessor# and a
* #CellAccessor# are both derived from #TriaAccessor#, we would have to make
* pass a second template parameter to a #DoFLineAccessor# which tells it
* which class to be derived from: if we are in one spatial dimension, the
* base class is to be #CellAccessor<1>#, in two or more dimensions it
- * is a #LineAccessor<dim>#, i.e. am accessor to lines without the missing
+ * is a #TriaObjectAccessor<1, dim>#, i.e. am accessor to lines without the missing
* functionality needed for cells (neighbors, etc.).
*
* This way we can declare a #DoFCellAccessor# in one dimension by deriving
- * from #DoFLineAccessor<1,CellAccessor<1> >#, thus getting the cell
+ * from #DoFObjectAccessor<1, 1,CellAccessor<1> >#, thus getting the cell
* functionality through the #DoFLineAccessor# instead of through a virtual
* multiple inheritance of #DoFLineAccessor# and #CellAccessor<1>#.
*
- * The same concept is used with #DoFQuadAccessor# classes etc.
+ * The same concept is used with #DoFObjectAccessor<2, dim># classes etc.
*
* @author Wolfgang Bangerth, 1998
*/
template <int dim, typename BaseClass>
-class MGDoFLineAccessor : public MGDoFAccessor<dim>, public DoFLineAccessor<dim, BaseClass> {
+class MGDoFObjectAccessor<1, dim, BaseClass> : public MGDoFAccessor<dim>,
+ public DoFObjectAccessor<1, dim, BaseClass>
+{
public:
/**
* Declare the data type that this accessor
* Default constructor, unused thus
* not implemented.
*/
- MGDoFLineAccessor ();
+ MGDoFObjectAccessor ();
/**
* Constructor. The #local_data#
* argument is assumed to be a pointer
* to a #MGDoFHandler<dim># object.
*/
- MGDoFLineAccessor (Triangulation<dim> *tria,
+ MGDoFObjectAccessor (Triangulation<dim> *tria,
const int level,
const int index,
const AccessorData *local_data);
* class returns a line accessor without
* access to the MG data.
*/
- TriaIterator<dim,MGDoFLineAccessor<dim,BaseClass> > child (const unsigned int) const;
+ TriaIterator<dim,MGDoFObjectAccessor<1, dim,BaseClass> > child (const unsigned int) const;
/**
* Implement the copy operator needed
* for the iterator classes.
*/
- void copy_from (const MGDoFLineAccessor<dim,BaseClass> &a);
+ void copy_from (const MGDoFObjectAccessor<1, dim,BaseClass> &a);
};
* @see DoFLineAccessor
*/
template <int dim, typename BaseClass>
-class MGDoFQuadAccessor : public MGDoFAccessor<dim>, public DoFQuadAccessor<dim, BaseClass> {
+class MGDoFObjectAccessor<2, dim, BaseClass> : public MGDoFAccessor<dim>, public DoFObjectAccessor<2, dim, BaseClass> {
public:
/**
* Declare the data type that this accessor
* Default constructor, unused thus
* not implemented.
*/
- MGDoFQuadAccessor ();
+ MGDoFObjectAccessor ();
/**
* Constructor. The #local_data#
* argument is assumed to be a pointer
* to a #DoFHandler<dim># object.
*/
- MGDoFQuadAccessor (Triangulation<dim> *tria,
+ MGDoFObjectAccessor (Triangulation<dim> *tria,
const int level,
const int index,
const AccessorData *local_data);
* Return a pointer to the #i#th line
* bounding this #Quad#.
*/
- TriaIterator<dim,MGDoFLineAccessor<dim,LineAccessor<dim> > >
+ TriaIterator<dim,MGDoFObjectAccessor<1, dim,TriaObjectAccessor<1, dim> > >
line (const unsigned int i) const;
/**
* class returns a quad accessor without
* access to the DoF data.
*/
- TriaIterator<dim,MGDoFQuadAccessor<dim,BaseClass> > child (const unsigned int) const;
+ TriaIterator<dim,MGDoFObjectAccessor<2, dim, BaseClass> > child (const unsigned int) const;
/**
* Implement the copy operator needed
* for the iterator classes.
*/
- void copy_from (const MGDoFQuadAccessor<dim,BaseClass> &a);
+ void copy_from (const MGDoFObjectAccessor<2, dim,BaseClass> &a);
};
* Return a pointer to the #i#th line
* bounding this #Hex#.
*/
- TriaIterator<dim,MGDoFLineAccessor<dim,LineAccessor<dim> > >
+ TriaIterator<dim,MGDoFObjectAccessor<1, dim,TriaObjectAccessor<1, dim> > >
line (const unsigned int i) const;
/**
* Return a pointer to the #i#th quad
* bounding this #Hex#.
*/
- TriaIterator<dim,MGDoFQuadAccessor<dim,QuadAccessor<dim> > >
+ TriaIterator<dim,MGDoFObjectAccessor<2, dim,TriaObjectAccessor<2, dim> > >
quad (const unsigned int i) const;
/**
* the compiler) happens to use this class.
*/
template <int dim>
-class MGDoFSubstructAccessor : public MGDoFLineAccessor<1,CellAccessor<1> > {
+class MGDoFSubstructAccessor : public MGDoFObjectAccessor<1, 1,CellAccessor<1> > {
public:
MGDoFSubstructAccessor () {
Assert (false, ExcInternalError());
* with template parameters. This class and #DoFSubstructAccessor<2>#
* wrap the following names:
* \begin{verbatim}
- * MGDoFSubstructAccessor<1> := MGDoFLineAccessor<1,CellAccessor<1> >;
- * MGDoFSubstructAccessor<2> := MGDoFQuadAccessor<2,CellAccessor<2> >;
+ * MGDoFSubstructAccessor<1> := MGDoFObjectAccessor<1, 1,CellAccessor<1> >;
+ * MGDoFSubstructAccessor<2> := MGDoFObjectAccessor<2, 2,CellAccessor<2> >;
* \end{verbatim}
* We do this rather complex (and needless, provided C++ the needed constructs!)
* class hierarchy manipulation, since this way we can declare and implement
* the \Ref{DoFCellAccessor} dimension independent as an inheritance from
* #DoFSubstructAccessor<dim>#. If we had not declared these
* types, we would have to write two class declarations, one for
- * #DoFCellAccessor<1>#, derived from #DoFLineAccessor<1,CellAccessor<1> >#
+ * #DoFCellAccessor<1>#, derived from #DoFObjectAccessor<1, 1,CellAccessor<1> >#
* and one for #DoFCellAccessor<2>#, derived from
- * #DoFQuadAccessor<2,CellAccessor<2> >#.
+ * #DoFObjectAccessor<2, 2,CellAccessor<2> >#.
*/
template <>
-class MGDoFSubstructAccessor<1> : public MGDoFLineAccessor<1,CellAccessor<1> > {
+class MGDoFSubstructAccessor<1> : public MGDoFObjectAccessor<1, 1,CellAccessor<1> > {
public:
/**
* Declare the data type that this accessor
* class expects to get passed from the
* iterator classes.
*/
- typedef MGDoFLineAccessor<1,CellAccessor<1> >::AccessorData AccessorData;
+ typedef MGDoFObjectAccessor<1, 1,CellAccessor<1> >::AccessorData AccessorData;
/**
* Constructor
const int level,
const int index,
const AccessorData *local_data) :
- MGDoFLineAccessor<1,CellAccessor<1> > (tria,level,index,local_data) {};
+ MGDoFObjectAccessor<1, 1,CellAccessor<1> > (tria,level,index,local_data) {};
// do this here, since this way the
// CellAccessor has the possibility to know
// what a face_iterator is. Otherwise
* @see MGDoFSubstructAccessor<1>
*/
template <>
-class MGDoFSubstructAccessor<2> : public MGDoFQuadAccessor<2,CellAccessor<2> > {
+class MGDoFSubstructAccessor<2> : public MGDoFObjectAccessor<2, 2,CellAccessor<2> > {
public:
/**
* Declare the data type that this accessor
* class expects to get passed from the
* iterator classes.
*/
- typedef MGDoFQuadAccessor<2,CellAccessor<2> >::AccessorData AccessorData;
+ typedef MGDoFObjectAccessor<2, 2,CellAccessor<2> >::AccessorData AccessorData;
/**
* Constructor
const int level,
const int index,
const AccessorData *local_data) :
- MGDoFQuadAccessor<2,CellAccessor<2> > (tria,level,index,local_data) {};
+ MGDoFObjectAccessor<2, 2,CellAccessor<2> > (tria,level,index,local_data) {};
// do this here, since this way the
// CellAccessor has the possibility to know
// what a face_iterator is. Otherwise
// it would have to ask the DoFHandler<dim>
// which would need another big include
// file and maybe cyclic interdependence
- typedef TriaIterator<2,MGDoFLineAccessor<2,LineAccessor<2> > > face_iterator;
+ typedef TriaIterator<2,MGDoFObjectAccessor<1, 2,TriaObjectAccessor<1, 2> > > face_iterator;
};
// it would have to ask the DoFHandler<dim>
// which would need another big include
// file and maybe cyclic interdependence
- typedef TriaIterator<3,MGDoFQuadAccessor<3,QuadAccessor<3> > > face_iterator;
+ typedef TriaIterator<3,MGDoFObjectAccessor<2, 3,TriaObjectAccessor<2, 3> > > face_iterator;
};
/**
* Grant access to the degrees of freedom on a cell. In fact, since all
* access to the degrees of freedom has been enabled by the classes
- * #DoFLineAccessor<1># and #DoFQuadAccessor<2># for the space dimension
+ * #DoFObjectAccessor<1, 1># and #DoFObjectAccessor<2, 2># for the space dimension
* one and two, respectively, this class only collects the pieces
* together by deriving from the appropriate #DoF*Accessor# and the
* right #CellAccessor<dim># and finally adding two functions which give
* of this cell.
*
* This function is not implemented in 1D,
- * and maps to MGDoFQuadAccessor::line in 2D.
+ * and maps to MGDoFObjectAccessor<2, dim>::line in 2D.
*/
typename MGDoFSubstructAccessor<dim>::face_iterator
face (const unsigned int i) const;
*/
class MGDoFDimensionInfo<2> {
public:
- typedef TriaRawIterator<2,MGDoFLineAccessor<2,LineAccessor<2> > > raw_line_iterator;
- typedef TriaIterator<2,MGDoFLineAccessor<2,LineAccessor<2> > > line_iterator;
- typedef TriaActiveIterator<2,MGDoFLineAccessor<2,LineAccessor<2> > > active_line_iterator;
+ typedef TriaRawIterator<2,MGDoFObjectAccessor<1, 2,TriaObjectAccessor<1, 2> > > raw_line_iterator;
+ typedef TriaIterator<2,MGDoFObjectAccessor<1, 2,TriaObjectAccessor<1, 2> > > line_iterator;
+ typedef TriaActiveIterator<2,MGDoFObjectAccessor<1, 2,TriaObjectAccessor<1, 2> > > active_line_iterator;
typedef TriaRawIterator<2,MGDoFCellAccessor<2> > raw_quad_iterator;
typedef TriaIterator<2,MGDoFCellAccessor<2> > quad_iterator;
*/
class MGDoFDimensionInfo<3> {
public:
- typedef TriaRawIterator<3,MGDoFLineAccessor<3,LineAccessor<3> > > raw_line_iterator;
- typedef TriaIterator<3,MGDoFLineAccessor<3,LineAccessor<3> > > line_iterator;
- typedef TriaActiveIterator<3,MGDoFLineAccessor<3,LineAccessor<3> > > active_line_iterator;
+ typedef TriaRawIterator<3,MGDoFObjectAccessor<1, 3,TriaObjectAccessor<1, 3> > > raw_line_iterator;
+ typedef TriaIterator<3,MGDoFObjectAccessor<1, 3,TriaObjectAccessor<1, 3> > > line_iterator;
+ typedef TriaActiveIterator<3,MGDoFObjectAccessor<1, 3,TriaObjectAccessor<1, 3> > > active_line_iterator;
- typedef TriaRawIterator<3,MGDoFQuadAccessor<3,QuadAccessor<3> > > raw_quad_iterator;
- typedef TriaIterator<3,MGDoFQuadAccessor<3,QuadAccessor<3> > > quad_iterator;
- typedef TriaActiveIterator<3,MGDoFQuadAccessor<3,QuadAccessor<3> > > active_quad_iterator;
+ typedef TriaRawIterator<3,MGDoFObjectAccessor<2, 3,TriaObjectAccessor<2, 3> > > raw_quad_iterator;
+ typedef TriaIterator<3,MGDoFObjectAccessor<2, 3,TriaObjectAccessor<2, 3> > > quad_iterator;
+ typedef TriaActiveIterator<3,MGDoFObjectAccessor<2, 3,TriaObjectAccessor<2, 3> > > active_quad_iterator;
typedef TriaRawIterator<3,MGDoFCellAccessor<3> > raw_hex_iterator;
typedef TriaIterator<3,MGDoFCellAccessor<3> > hex_iterator;
*/
/*@{*/
/**
- * Return iterator to the first cell, used
+ * Iterator to the first cell, used
* or not, on level #level#. If a level
* has no cells, a past-the-end iterator
* is returned.
raw_cell_iterator begin_raw (const unsigned int level = 0) const;
/**
- * Return iterator to the first used cell
+ * Iterator to the first used cell
* on level #level#.
*
* This function calls #begin_line#
cell_iterator begin (const unsigned int level = 0) const;
/**
- * Return iterator to the first active
+ * Iterator to the first active
* cell on level #level#.
*
* This function calls #begin_active_line#
active_cell_iterator begin_active(const unsigned int level = 0) const;
/**
- * Return iterator past the end; this
+ * Iterator past the end; this
* iterator serves for comparisons of
* iterators with past-the-end or
* before-the-beginning states.
*/
/*@{*/
/**
- * Return iterator to the first face, used
+ * Iterator to the first face, used
* or not, on level #level#. If a level
* has no faces, a past-the-end iterator
* is returned.
raw_face_iterator begin_raw_face (const unsigned int level = 0) const;
/**
- * Return iterator to the first used face
+ * Iterator to the first used face
* on level #level#.
*
* This function calls #begin_line#
face_iterator begin_face (const unsigned int level = 0) const;
/**
- * Return iterator to the first active
+ * Iterator to the first active
* face on level #level#.
*
* This function calls #begin_active_line#
active_face_iterator begin_active_face(const unsigned int level = 0) const;
/**
- * Return iterator past the end; this
+ * Iterator past the end; this
* iterator serves for comparisons of
* iterators with past-the-end or
* before-the-beginning states.
*/
/*@{*/
/**
- * Return iterator to the first line, used
+ * Iterator to the first line, used
* or not, on level #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;
/**
- * Return iterator to the first used line
+ * Iterator to the first used line
* on level #level#.
*/
line_iterator begin_line (const unsigned int level = 0) const;
/**
- * Return iterator to the first active
+ * Iterator to the first active
* line on level #level#.
*/
active_line_iterator begin_active_line(const unsigned int level = 0) const;
/**
- * Return iterator past the end; this
+ * Iterator past the end; this
* iterator serves for comparisons of
* iterators with past-the-end or
* before-the-beginning states.
/*@{
*/
/**
- * Return iterator to the first quad, used
+ * Iterator to the first quad, used
* or not, on level #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;
/**
- * Return iterator to the first used quad
+ * Iterator to the first used quad
* on level #level#.
*/
quad_iterator begin_quad (const unsigned int level = 0) const;
/**
- * Return iterator to the first active
+ * Iterator to the first active
* quad on level #level#.
*/
active_quad_iterator begin_active_quad(const unsigned int level = 0) const;
/**
- * Return iterator past the end; this
+ * Iterator past the end; this
* iterator serves for comparisons of
* iterators with past-the-end or
* before-the-beginning states.
/*@{
*/
/**
- * Return iterator to the first hex, used
+ * Iterator to the first hex, used
* or not, on level #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;
/**
- * Return iterator to the first used hex
+ * Iterator to the first used hex
* on level #level#.
*/
hex_iterator begin_hex (const unsigned int level = 0) const;
/**
- * Return iterator to the first active
+ * Iterator to the first active
* hex on level #level#.
*/
active_hex_iterator begin_active_hex(const unsigned int level = 0) const;
/**
- * Return iterator past the end; this
+ * Iterator past the end; this
* iterator serves for comparisons of
* iterators with past-the-end or
* before-the-beginning states.
* Exception.
*/
DeclException0 (ExcNoMemory);
- /**
- * Exception.
-
- */
- DeclException0 (ExcInvalidIndex);
/**
* Exception.
*/
*/
vector<unsigned int> mg_used_dofs;
- friend class MGDoFLineAccessor<dim, LineAccessor<dim> >;
- friend class MGDoFLineAccessor<dim, CellAccessor<dim> >;
- friend class MGDoFQuadAccessor<dim, QuadAccessor<dim> >;
- friend class MGDoFQuadAccessor<dim, CellAccessor<dim> >;
+ friend class MGDoFObjectAccessor<1, dim, TriaObjectAccessor<1, dim> >;
+ friend class MGDoFObjectAccessor<1, dim, CellAccessor<dim> >;
+ friend class MGDoFObjectAccessor<2, dim, TriaObjectAccessor<2, dim> >;
+ friend class MGDoFObjectAccessor<2, dim, CellAccessor<dim> >;
friend class MGDoFHexAccessor<dim, HexAccessor<dim> >;
friend class MGDoFHexAccessor<dim, CellAccessor<dim> >;
};
const unsigned int index) {
Assert ((level >= coarsest_level) && (level <= finest_level),
ExcInvalidLevel(level));
- Assert (dof_number < dofs_per_vertex, ExcInvalidIndex ());
+ Assert (dof_number < dofs_per_vertex,
+ ExcIndexRange(dof_number, 0, dofs_per_vertex));
indices[(level-coarsest_level)*dofs_per_vertex + dof_number] = index;
};
const unsigned int dofs_per_vertex) const {
Assert ((level >= coarsest_level) && (level <= finest_level),
ExcInvalidLevel(level));
- Assert (dof_number < dofs_per_vertex, ExcInvalidIndex ());
+ Assert (dof_number < dofs_per_vertex,
+ ExcIndexRange (dof_number, 0, dofs_per_vertex));
return indices[(level-coarsest_level)*dofs_per_vertex + dof_number];
};
unsigned int component_to_base(unsigned int index) const;
- /**
- * Exception
- */
- DeclException1 (ExcInvalidIndex,
- int,
- << "Invalid index " << arg1);
/**
* Exception
*/
FiniteElementBase<dim>::component_to_system_index (unsigned int component,
unsigned int component_index) const
{
- Assert(component<n_components, ExcInvalidIndex(component));
+ Assert(component<n_components,
+ ExcIndexRange(component, 0, n_components));
Assert(component_index<component_to_system_table[component].size(),
- ExcInvalidIndex(component_index));
+ ExcIndexRange(component_index, 0,
+ component_to_system_table[component].size()));
return component_to_system_table[component][component_index];
}
pair<unsigned int,unsigned int>
FiniteElementBase<dim>::system_to_component_index (unsigned int index) const
{
- Assert(index < system_to_component_table.size(), ExcInvalidIndex(index));
+ Assert(index < system_to_component_table.size(),
+ ExcIndexRange(index, 0, system_to_component_table.size()));
return system_to_component_table[index];
}
FiniteElementBase<dim>::face_component_to_system_index (unsigned int component,
unsigned int component_index) const
{
- Assert(component<n_components, ExcInvalidIndex(component));
+ Assert(component<n_components,
+ ExcIndexRange(component, 0, n_components));
Assert(component_index<face_component_to_system_table[component].size(),
- ExcInvalidIndex(component_index));
+ ExcIndexRange(component_index, 0,
+ face_component_to_system_table[component].size()));
return face_component_to_system_table[component][component_index];
}
pair<unsigned int,unsigned int>
FiniteElementBase<dim>::face_system_to_component_index (unsigned int index) const
{
- Assert(index < system_to_component_table.size(), ExcInvalidIndex(index));
+ Assert(index < face_system_to_component_table.size(),
+ ExcIndexRange(index, 0, face_system_to_component_table.size()));
return face_system_to_component_table[index];
}
{
if (n_components == 1)
return 0;
- Assert(index < component_to_base_table.size(), ExcInvalidIndex(index));
+ Assert(index < component_to_base_table.size(),
+ ExcIndexRange(index, 0, component_to_base_table.size()));
return component_to_base_table[index];
}
*/
const FiniteElement<dim> & get_fe () const;
- /**
- * Exception
- */
- DeclException2 (ExcInvalidIndex,
- int, int,
- << "The index " << arg1
- << " is out of range, it should be less than " << arg2);
/**
* Exception
*/
template <int dim>
inline
-const FullMatrix<double> & FEValuesBase<dim>::get_shape_values () const {
+const FullMatrix<double> & FEValuesBase<dim>::get_shape_values () const
+{
Assert (selected_dataset<shape_values.size(),
- ExcInvalidIndex (selected_dataset, shape_values.size()));
+ ExcIndexRange (selected_dataset, 0, shape_values.size()));
return shape_values[selected_dataset];
};
template <int dim>
inline
const vector<vector<Tensor<1,dim> > > &
-FEValuesBase<dim>::get_shape_grads () const {
+FEValuesBase<dim>::get_shape_grads () const
+{
Assert (update_flags & update_gradients, ExcAccessToUninitializedField());
return shape_gradients;
};
template <int dim>
inline
const vector<vector<Tensor<2,dim> > > &
-FEValuesBase<dim>::get_shape_2nd_derivatives () const {
+FEValuesBase<dim>::get_shape_2nd_derivatives () const
+{
Assert (update_flags & update_second_derivatives, ExcAccessToUninitializedField());
return shape_2nd_derivatives;
};
static unsigned int child_cell_on_face (unsigned int face,
unsigned int subface);
- /**
- * Exception */
- DeclException2 (ExcInvalidIndex,
- int,
- int,
- << "Invalid index " << arg1
- << ", index must be between 0 and " << arg2 << ".");
};
GeometryInfo<2>::child_cell_on_face (const unsigned int face,
const unsigned int subface)
{
- Assert (face<faces_per_cell, ExcInvalidIndex(face,faces_per_cell));
- Assert (subface<subfaces_per_face, ExcInvalidIndex(subface,subfaces_per_face));
+ Assert (face<faces_per_cell, ExcIndexRange(face, 0, faces_per_cell));
+ Assert (subface<subfaces_per_face, ExcIndexRange(subface, 0, subfaces_per_face));
static const unsigned subcells[faces_per_cell][subfaces_per_face] = {{0,1},
{1,2},
template<>
inline
unsigned int GeometryInfo<3>::child_cell_on_face (const unsigned int face,
- const unsigned int subface) {
- Assert (face<faces_per_cell, ExcInvalidIndex(face,faces_per_cell));
- Assert (subface<subfaces_per_face, ExcInvalidIndex(subface,subfaces_per_face));
+ const unsigned int subface)
+{
+ Assert (face<faces_per_cell, ExcIndexRange(face, 0, faces_per_cell));
+ Assert (subface<subfaces_per_face, ExcIndexRange(subface, 0, subfaces_per_face));
static const unsigned subcells[faces_per_cell][subfaces_per_face] = {{0, 1, 2, 3},
{4, 5, 6, 7},
template <>
class TriaDimensionInfo<2> {
public:
- typedef TriaRawIterator<2,LineAccessor<2> > raw_line_iterator;
- typedef TriaIterator<2,LineAccessor<2> > line_iterator;
- typedef TriaActiveIterator<2,LineAccessor<2> > active_line_iterator;
+ typedef TriaRawIterator<2,TriaObjectAccessor<1, 2> > raw_line_iterator;
+ typedef TriaIterator<2,TriaObjectAccessor<1, 2> > line_iterator;
+ typedef TriaActiveIterator<2,TriaObjectAccessor<1, 2> > active_line_iterator;
typedef TriaRawIterator<2,CellAccessor<2> > raw_quad_iterator;
typedef TriaIterator<2,CellAccessor<2> > quad_iterator;
template <>
class TriaDimensionInfo<3> {
public:
- typedef TriaRawIterator<3,LineAccessor<3> > raw_line_iterator;
- typedef TriaIterator<3,LineAccessor<3> > line_iterator;
- typedef TriaActiveIterator<3,LineAccessor<3> > active_line_iterator;
+ typedef TriaRawIterator<3,TriaObjectAccessor<1, 3> > raw_line_iterator;
+ typedef TriaIterator<3,TriaObjectAccessor<1, 3> > line_iterator;
+ typedef TriaActiveIterator<3,TriaObjectAccessor<1, 3> > active_line_iterator;
- typedef TriaRawIterator<3,QuadAccessor<3> > raw_quad_iterator;
- typedef TriaIterator<3,QuadAccessor<3> > quad_iterator;
- typedef TriaActiveIterator<3,QuadAccessor<3> > active_quad_iterator;
+ typedef TriaRawIterator<3,TriaObjectAccessor<2, 3> > raw_quad_iterator;
+ typedef TriaIterator<3,TriaObjectAccessor<2, 3> > quad_iterator;
+ typedef TriaActiveIterator<3,TriaObjectAccessor<2, 3> > active_quad_iterator;
typedef TriaRawIterator<3,CellAccessor<3> > raw_hex_iterator;
typedef TriaIterator<3,CellAccessor<3> > hex_iterator;
*/
/*@{*/
/**
- * Return iterator to the first cell, used
+ * Iterator to the first cell, used
* or not, on level #level#. If a level
* has no cells, a past-the-end iterator
* is returned.
raw_cell_iterator begin_raw (const unsigned int level = 0) const;
/**
- * Return iterator to the first used cell
+ * Iterator to the first used cell
* on level #level#.
*
* This function calls #begin_line#
cell_iterator begin (const unsigned int level = 0) const;
/**
- * Return iterator to the first active
+ * Iterator to the first active
* cell on level #level#.
*
* This function calls #begin_active_line#
active_cell_iterator begin_active(const unsigned int level = 0) const;
/**
- * Return iterator past the end; this
+ * Iterator past the end; this
* iterator serves for comparisons of
* iterators with past-the-end or
* before-the-beginning states.
*/
/*@{*/
/**
- * Return iterator to the first face, used
+ * Iterator to the first face, used
* or not, on level #level#. If a level
* has no faces, a past-the-end iterator
* is returned.
raw_face_iterator begin_raw_face (const unsigned int level = 0) const;
/**
- * Return iterator to the first used face
+ * Iterator to the first used face
* on level #level#.
*
* This function calls #begin_line#
face_iterator begin_face (const unsigned int level = 0) const;
/**
- * Return iterator to the first active
+ * Iterator to the first active
* face on level #level#.
*
* This function calls #begin_active_line#
active_face_iterator begin_active_face(const unsigned int level = 0) const;
/**
- * Return iterator past the end; this
+ * Iterator past the end; this
* iterator serves for comparisons of
* iterators with past-the-end or
* before-the-beginning states.
*/
/*@{*/
/**
- * Return iterator to the first line, used
+ * Iterator to the first line, used
* or not, on level #level#. If a level
* has no lines, a past-the-end iterator
* is returned.
begin_raw_line (const unsigned int level = 0) const;
/**
- * Return iterator to the first used line
+ * Iterator to the first used line
* on level #level#.
*/
line_iterator
begin_line (const unsigned int level = 0) const;
/**
- * Return iterator to the first active
+ * Iterator to the first active
* line on level #level#.
*/
active_line_iterator
begin_active_line(const unsigned int level = 0) const;
/**
- * Return iterator past the end; this
+ * Iterator past the end; this
* iterator serves for comparisons of
* iterators with past-the-end or
* before-the-beginning states.
/*@{
*/
/**
- * Return iterator to the first quad, used
+ * Iterator to the first quad, used
* or not, on level #level#. If a level
* has no quads, a past-the-end iterator
* is returned.
begin_raw_quad (const unsigned int level = 0) const;
/**
- * Return iterator to the first used quad
+ * Iterator to the first used quad
* on level #level#.
*/
quad_iterator
begin_quad (const unsigned int level = 0) const;
/**
- * Return iterator to the first active
+ * Iterator to the first active
* quad on level #level#.
*/
active_quad_iterator
begin_active_quad(const unsigned int level = 0) const;
/**
- * Return iterator past the end; this
+ * Iterator past the end; this
* iterator serves for comparisons of
* iterators with past-the-end or
* before-the-beginning states.
/*@{
*/
/**
- * Return iterator to the first hex, used
+ * Iterator to the first hex, used
* or not, on level #level#. If a level
* has no hexs, a past-the-end iterator
* is returned.
begin_raw_hex (const unsigned int level = 0) const;
/**
- * Return iterator to the first used hex
+ * Iterator to the first used hex
* on level #level#.
*/
hex_iterator
begin_hex (const unsigned int level = 0) const;
/**
- * Return iterator to the first active
+ * Iterator to the first active
* hex on level #level#.
*/
active_hex_iterator
begin_active_hex(const unsigned int level = 0) const;
/**
- * Return iterator past the end; this
+ * Iterator past the end; this
* iterator serves for comparisons of
* iterators with past-the-end or
* before-the-beginning states.
// Friendship includes local classes.
friend class TriaAccessor<dim>;
- friend class LineAccessor<dim>;
- friend class QuadAccessor<dim>;
+ friend class TriaObjectAccessor<1, dim>;
+ friend class TriaObjectAccessor<2, dim>;
friend class HexAccessor<dim>;
friend class CellAccessor<dim>;
- friend class TriaRawIterator<1,LineAccessor<1> >;
+ friend class TriaRawIterator<1,TriaObjectAccessor<1, 1> >;
friend class TriaRawIterator<1,CellAccessor<1> >;
- friend class TriaRawIterator<2,LineAccessor<2> >;
- friend class TriaRawIterator<2,QuadAccessor<2> >;
+ friend class TriaRawIterator<2,TriaObjectAccessor<1, 2> >;
+ friend class TriaRawIterator<2,TriaObjectAccessor<2, 2> >;
friend class TriaRawIterator<2,CellAccessor<2> >;
- friend class TriaRawIterator<3,LineAccessor<3> >;
- friend class TriaRawIterator<3,QuadAccessor<3> >;
+ friend class TriaRawIterator<3,TriaObjectAccessor<1, 3> >;
+ friend class TriaRawIterator<3,TriaObjectAccessor<2, 3> >;
friend class TriaRawIterator<3,HexAccessor<3> >;
friend class TriaRawIterator<3,CellAccessor<3> >;
* @author Wolfgang Bangerth, 1998
*/
template <int dim>
-class TriaAccessor {
+class TriaAccessor
+{
protected:
/**
* Declare the data type that this accessor
* Constructor. Protected, thus
* only callable from friend
* classes.
+ * //TODO: Could be private: check!
*/
TriaAccessor (Triangulation<dim> *parent = 0,
const int level = -1,
/**
* Exception
*/
- DeclException3 (ExcInvalidIndex,
- int,
- int,
- int,
- << "Invalid index " << arg1
- << ", index must be between " << arg2
- << " and " << arg3 << ".");
- /**
- * Exception
- */
DeclException0 (ExcUncaughtCase);
/**
* Exception
+/**
+ * Common template for line, quad, hex.
+ * @author Guido Kanschat, 1999
+ */
+template<int celldim, int dim>
+class TriaObjectAccessor;
+
* @author Wolfgang Bangerth, 1998
*/
template <int dim>
-class LineAccessor : public TriaAccessor<dim> {
+class TriaObjectAccessor<1, dim> : public TriaAccessor<dim>
+{
public:
/**
* Constructor.
*/
- LineAccessor (Triangulation<dim> *parent = 0,
+ TriaObjectAccessor (Triangulation<dim> *parent = 0,
const int level = -1,
const int index = -1,
const void *local_data = 0) :
* Return a pointer to the #i#th
* child.
*/
- TriaIterator<dim,LineAccessor<dim> > child (const unsigned int i) const;
+ TriaIterator<dim,TriaObjectAccessor<1, dim> > child (const unsigned int i) const;
/**
* Return the index of the #i#th child.
* and will give a linker error if
* used anyway.
*/
- void operator = (const LineAccessor &);
+ void operator = (const TriaObjectAccessor<1, dim> &);
template <int anydim, typename AnyAccessor> friend class TriaRawIterator;
};
-
-
/**
* Accessor to dereference the data of quads. This accessor is used to
* point to quads in #dim# space dimensions (only #dim>=2# seems reasonable
* @author Wolfgang Bangerth, 1998
*/
template <int dim>
-class QuadAccessor : public TriaAccessor<dim> {
+class TriaObjectAccessor<2, dim> : public TriaAccessor<dim>
+{
public:
/**
* Constructor.
*/
- QuadAccessor (Triangulation<dim> *parent = 0,
+ TriaObjectAccessor (Triangulation<dim> *parent = 0,
const int level = -1,
const int index = -1,
const void *local_data = 0) :
* Return a pointer to the #i#th line
* bounding this #Quad#.
*/
- TriaIterator<dim,LineAccessor<dim> > line (const unsigned int i) const;
+ TriaIterator<dim,TriaObjectAccessor<1, dim> > line (const unsigned int i) const;
/**
* Return the line index of the #i#th
* Return a pointer to the #i#th
* child.
*/
- TriaIterator<dim,QuadAccessor<dim> > child (const unsigned int i) const;
+ TriaIterator<dim,TriaObjectAccessor<2, dim> > child (const unsigned int i) const;
/**
* Return the index of the #i#th child.
* and will give a linker error if
* used anyway.
*/
- void operator = (const QuadAccessor &);
+ void operator = (const TriaObjectAccessor<2, dim> &);
protected:
/**@name Advancement of iterators*/
* Return a pointer to the #i#th line
* bounding this #Hex#.
*/
- TriaIterator<dim,LineAccessor<dim> > line (const unsigned int i) const;
+ TriaIterator<dim,TriaObjectAccessor<1, dim> > line (const unsigned int i) const;
/**
* Return the line index of the #i#th
* Return a pointer to the #i#th quad
* bounding this #Hex#.
*/
- TriaIterator<dim,QuadAccessor<dim> > quad (const unsigned int i) const;
+ TriaIterator<dim,TriaObjectAccessor<2, dim> > quad (const unsigned int i) const;
/**
* Return the quad index of the #i#th
* with template parameters. This class and #TriaSubstructAccessor<2>#
* wrap the following names:
* \begin{verbatim}
- * TriaSubstructAccessor<1> := LineAccessor<1>;
- * TriaSubstructAccessor<2> := QuadAccessor<2>;
+ * TriaSubstructAccessor<1> := TriaObjectAccessor<1, 1>;
+ * TriaSubstructAccessor<2> := TriaObjectAccessor<2, 2>;
* TriaSubstructAccessor<3> := HexAccessor<3>;
* \end{verbatim}
* We do this rather complex (and needless, provided C++ the needed constructs!)
* the \Ref{CellAccessor} dimension independent as an inheritance from
* #TriaSubstructAccessor<dim>#. If we had not declared these
* types, we would have to write two class declarations, one for
- * #CellAccessor<1>#, derived from #LineAccessor<1>#
+ * #CellAccessor<1>#, derived from #TriaObjectAccessor<1, 1>#
* and one for #CellAccessor<2>#, derived from
- * #QuadAccessor<2>#.
+ * #TriaObjectAccessor<2, 2>#.
*/
template <>
-class TriaSubstructAccessor<1> : public LineAccessor<1> {
+class TriaSubstructAccessor<1> : public TriaObjectAccessor<1, 1> {
public:
/**
* Propagate the AccessorData type
* into the present class.
*/
- typedef LineAccessor<1>::AccessorData AccessorData;
+ typedef TriaObjectAccessor<1, 1>::AccessorData AccessorData;
/**
* Constructor
*/
const int level,
const int index,
const void *local_data) :
- LineAccessor<1> (tria,level,index,local_data) {};
+ TriaObjectAccessor<1, 1> (tria,level,index,local_data) {};
// do this here, since this way the
// CellAccessor has the possibility to know
* @see TriaSubstructAccessor<1>
*/
template <>
-class TriaSubstructAccessor<2> : public QuadAccessor<2> {
+class TriaSubstructAccessor<2> : public TriaObjectAccessor<2, 2> {
public:
/**
* Propagate the AccessorData type
* into the present class.
*/
- typedef QuadAccessor<2>::AccessorData AccessorData;
+ typedef TriaObjectAccessor<2, 2>::AccessorData AccessorData;
/**
* Constructor
*/
const int level,
const int index,
const void *local_data) :
- QuadAccessor<2> (tria,level,index,local_data) {};
+ TriaObjectAccessor<2, 2> (tria,level,index,local_data) {};
// do this here, since this way the
// CellAccessor has the possibility to know
// it would have to ask the DoFHandler<dim>
// which would need another big include
// file and maybe cyclic interdependence
- typedef TriaIterator<2,LineAccessor<2> > substruct_iterator;
+ typedef TriaIterator<2,TriaObjectAccessor<1, 2> > substruct_iterator;
};
// it would have to ask the DoFHandler<dim>
// which would need another big include
// file and maybe cyclic interdependence
- typedef TriaIterator<3,QuadAccessor<3> > substruct_iterator;
+ typedef TriaIterator<3,TriaObjectAccessor<2, 3> > substruct_iterator;
};
template <int dim>
inline
bool
-LineAccessor<dim>::used () const {
+TriaObjectAccessor<1, dim>::used () const {
Assert (state() == valid, ExcDereferenceInvalidObject());
return tria->levels[present_level]->lines.used[present_index];
};
template <int dim>
inline
bool
-LineAccessor<dim>::user_flag_set () const {
+TriaObjectAccessor<1, dim>::user_flag_set () const {
Assert (used(), ExcCellNotUsed());
return tria->levels[present_level]->lines.user_flags[present_index];
};
template <int dim>
inline
void
-LineAccessor<dim>::set_user_flag () const {
+TriaObjectAccessor<1, dim>::set_user_flag () const {
Assert (used(), ExcCellNotUsed());
tria->levels[present_level]->lines.user_flags[present_index] = true;
};
template <int dim>
inline
void
-LineAccessor<dim>::clear_user_flag () const {
+TriaObjectAccessor<1, dim>::clear_user_flag () const {
Assert (used(), ExcCellNotUsed());
tria->levels[present_level]->lines.user_flags[present_index] = false;
};
template <int dim>
inline
-TriaIterator<dim,LineAccessor<dim> >
-LineAccessor<dim>::child (const unsigned int i) const {
+TriaIterator<dim,TriaObjectAccessor<1, dim> >
+TriaObjectAccessor<1, dim>::child (const unsigned int i) const {
Assert (i<2, ExcIndexRange(i,0,2));
- TriaIterator<dim,LineAccessor<dim> > q (tria, present_level+1, child_index (i));
+ TriaIterator<dim,TriaObjectAccessor<1, dim> > q (tria, present_level+1, child_index (i));
#ifdef DEBUG
if (q.state() != past_the_end)
template <int dim>
inline
int
-LineAccessor<dim>::child_index (unsigned int i) const {
+TriaObjectAccessor<1, dim>::child_index (unsigned int i) const {
Assert (i<2, ExcIndexRange(i,0,2));
return tria->levels[present_level]->lines.children[present_index]+i;
};
template <int dim>
inline
bool
-LineAccessor<dim>::has_children () const {
+TriaObjectAccessor<1, dim>::has_children () const {
Assert (state() == valid, ExcDereferenceInvalidObject());
return (tria->levels[present_level]->lines.children[present_index] != -1);
}
template <int dim>
inline
unsigned int
-LineAccessor<dim>::max_refinement_depth () const
+TriaObjectAccessor<1, dim>::max_refinement_depth () const
{
if (!has_children())
return 0;
template <int dim>
inline
void
-LineAccessor<dim>::operator ++ () {
+TriaObjectAccessor<1, dim>::operator ++ () {
++present_index;
// is index still in the range of
// the vector?
template <int dim>
inline
void
-LineAccessor<dim>::operator -- () {
+TriaObjectAccessor<1, dim>::operator -- () {
--present_index;
// is index still in the range of
// the vector?
template <int dim>
inline
bool
-QuadAccessor<dim>::used () const {
+TriaObjectAccessor<2, dim>::used () const {
Assert (state() == valid, ExcDereferenceInvalidObject());
return tria->levels[present_level]->quads.used[present_index];
};
template <int dim>
inline
bool
-QuadAccessor<dim>::user_flag_set () const {
+TriaObjectAccessor<2, dim>::user_flag_set () const {
Assert (used(), ExcCellNotUsed());
return tria->levels[present_level]->quads.user_flags[present_index];
};
template <int dim>
inline
void
-QuadAccessor<dim>::set_user_flag () const {
+TriaObjectAccessor<2, dim>::set_user_flag () const {
Assert (used(), ExcCellNotUsed());
tria->levels[present_level]->quads.user_flags[present_index] = true;
};
template <int dim>
inline
void
-QuadAccessor<dim>::clear_user_flag () const {
+TriaObjectAccessor<2, dim>::clear_user_flag () const {
Assert (used(), ExcCellNotUsed());
tria->levels[present_level]->quads.user_flags[present_index] = false;
};
template <int dim>
inline
-TriaIterator<dim,LineAccessor<dim> >
-QuadAccessor<dim>::line (const unsigned int i) const {
+TriaIterator<dim,TriaObjectAccessor<1, dim> >
+TriaObjectAccessor<2, dim>::line (const unsigned int i) const {
return
- TriaIterator<dim,LineAccessor<dim> >
+ TriaIterator<dim,TriaObjectAccessor<1, dim> >
(
tria,
present_level,
template <int dim>
inline
unsigned int
-QuadAccessor<dim>::line_index (unsigned int i) const {
+TriaObjectAccessor<2, dim>::line_index (unsigned int i) const {
Assert (i<4, ExcIndexRange(i,0,4));
return tria->levels[present_level]->quads.quads[present_index].line(i);
template <int dim>
inline
-TriaIterator<dim,QuadAccessor<dim> >
-QuadAccessor<dim>::child (const unsigned int i) const {
+TriaIterator<dim,TriaObjectAccessor<2, dim> >
+TriaObjectAccessor<2, dim>::child (const unsigned int i) const {
Assert (i<4, ExcIndexRange(i,0,4));
- TriaIterator<dim,QuadAccessor<dim> > q (tria, present_level+1, child_index (i));
+ TriaIterator<dim,TriaObjectAccessor<2, dim> > q (tria, present_level+1, child_index (i));
#ifdef DEBUG
if (q.state() != past_the_end)
template <int dim>
inline
-int QuadAccessor<dim>::child_index (unsigned int i) const {
+int TriaObjectAccessor<2, dim>::child_index (unsigned int i) const {
Assert (i<4, ExcIndexRange(i,0,4));
return tria->levels[present_level]->quads.children[present_index]+i;
};
template <int dim>
inline
bool
-QuadAccessor<dim>::has_children () const {
+TriaObjectAccessor<2, dim>::has_children () const {
Assert (state() == valid, ExcDereferenceInvalidObject());
return (tria->levels[present_level]->quads.children[present_index] != -1);
};
template <int dim>
inline
unsigned int
-QuadAccessor<dim>::max_refinement_depth () const
+TriaObjectAccessor<2, dim>::max_refinement_depth () const
{
if (!has_children())
return 0;
template <int dim>
inline
void
-QuadAccessor<dim>::operator ++ () {
+TriaObjectAccessor<2, dim>::operator ++ () {
++present_index;
// is index still in the range of
// the vector?
template <int dim>
inline
void
-QuadAccessor<dim>::operator -- () {
+TriaObjectAccessor<2, dim>::operator -- () {
--present_index;
// is index still in the range of
// the vector?
template <int dim>
inline
-TriaIterator<dim,LineAccessor<dim> >
+TriaIterator<dim,TriaObjectAccessor<1, dim> >
HexAccessor<dim>::line (const unsigned int i) const {
Assert (used(), ExcCellNotUsed());
Assert (i<12, ExcIndexRange (i,0,12));
return quad(4)->line(3);
};
Assert (false, ExcIndexRange(i,0,12));
- return TriaIterator<dim,LineAccessor<dim> >(tria, -1, -1, 0);
+ return TriaIterator<dim,TriaObjectAccessor<1, dim> >(tria, -1, -1, 0);
};
template <int dim>
inline
-TriaIterator<dim,QuadAccessor<dim> >
+TriaIterator<dim,TriaObjectAccessor<2, dim> >
HexAccessor<dim>::quad (const unsigned int i) const {
Assert (used(), ExcCellNotUsed());
return
- TriaIterator<dim,QuadAccessor<dim> >
+ TriaIterator<dim,TriaObjectAccessor<2, dim> >
(
tria,
present_level,
};
-
+template <int celldim, int dim, typename BaseClass>
+class MGDoFObjectAccessor;
/**
* Unfortunately, we would run into problems, if we wanted a #DoFLineAccessor#
* in one spatial dimension, in which case a line is also a cell. The traditional
* solution would be to declare a #DoFCellAccessor<1># which is derived from
- * #DoFLineAccessor<1># and #CellAccessor<1># (the #DoFLineAccessor<dim># cannot
+ * #DoFObjectAccessor<1, 1># and #CellAccessor<1># (the #DoFObjectAccessor<1, dim># cannot
* itself be derived from #CellAccessor<dim># since a line is not a cell
* unless in one space dimension), but since a #DoFLineAccessor# and a
* #CellAccessor# are both derived from #TriaAccessor#, we would have to make
* pass a second template parameter to a #DoFLineAccessor# which tells it
* which class to be derived from: if we are in one spatial dimension, the
* base class is to be #CellAccessor<1>#, in two or more dimensions it
- * is a #LineAccessor<dim>#, i.e. am accessor to lines without the missing
+ * is a #TriaObjectAccessor<1, dim>#, i.e. am accessor to lines without the missing
* functionality needed for cells (neighbors, etc.).
*
* This way we can declare a #DoFCellAccessor# in one dimension by deriving
- * from #DoFLineAccessor<1,CellAccessor<1> >#, thus getting the cell
+ * from #DoFObjectAccessor<1, 1,CellAccessor<1> >#, thus getting the cell
* functionality through the #DoFLineAccessor# instead of through a virtual
* multiple inheritance of #DoFLineAccessor# and #CellAccessor<1>#.
*
- * The same concept is used with #DoFQuadAccessor# classes etc.
+ * The same concept is used with #DoFObjectAccessor<2, dim># classes etc.
*
* @author Wolfgang Bangerth, 1998
*/
template <int dim, typename BaseClass>
-class MGDoFLineAccessor : public MGDoFAccessor<dim>, public DoFLineAccessor<dim, BaseClass> {
+class MGDoFObjectAccessor<1, dim, BaseClass> : public MGDoFAccessor<dim>,
+ public DoFObjectAccessor<1, dim, BaseClass>
+{
public:
/**
* Declare the data type that this accessor
* Default constructor, unused thus
* not implemented.
*/
- MGDoFLineAccessor ();
+ MGDoFObjectAccessor ();
/**
* Constructor. The #local_data#
* argument is assumed to be a pointer
* to a #MGDoFHandler<dim># object.
*/
- MGDoFLineAccessor (Triangulation<dim> *tria,
+ MGDoFObjectAccessor (Triangulation<dim> *tria,
const int level,
const int index,
const AccessorData *local_data);
* class returns a line accessor without
* access to the MG data.
*/
- TriaIterator<dim,MGDoFLineAccessor<dim,BaseClass> > child (const unsigned int) const;
+ TriaIterator<dim,MGDoFObjectAccessor<1, dim,BaseClass> > child (const unsigned int) const;
/**
* Implement the copy operator needed
* for the iterator classes.
*/
- void copy_from (const MGDoFLineAccessor<dim,BaseClass> &a);
+ void copy_from (const MGDoFObjectAccessor<1, dim,BaseClass> &a);
};
* @see DoFLineAccessor
*/
template <int dim, typename BaseClass>
-class MGDoFQuadAccessor : public MGDoFAccessor<dim>, public DoFQuadAccessor<dim, BaseClass> {
+class MGDoFObjectAccessor<2, dim, BaseClass> : public MGDoFAccessor<dim>, public DoFObjectAccessor<2, dim, BaseClass> {
public:
/**
* Declare the data type that this accessor
* Default constructor, unused thus
* not implemented.
*/
- MGDoFQuadAccessor ();
+ MGDoFObjectAccessor ();
/**
* Constructor. The #local_data#
* argument is assumed to be a pointer
* to a #DoFHandler<dim># object.
*/
- MGDoFQuadAccessor (Triangulation<dim> *tria,
+ MGDoFObjectAccessor (Triangulation<dim> *tria,
const int level,
const int index,
const AccessorData *local_data);
* Return a pointer to the #i#th line
* bounding this #Quad#.
*/
- TriaIterator<dim,MGDoFLineAccessor<dim,LineAccessor<dim> > >
+ TriaIterator<dim,MGDoFObjectAccessor<1, dim,TriaObjectAccessor<1, dim> > >
line (const unsigned int i) const;
/**
* class returns a quad accessor without
* access to the DoF data.
*/
- TriaIterator<dim,MGDoFQuadAccessor<dim,BaseClass> > child (const unsigned int) const;
+ TriaIterator<dim,MGDoFObjectAccessor<2, dim, BaseClass> > child (const unsigned int) const;
/**
* Implement the copy operator needed
* for the iterator classes.
*/
- void copy_from (const MGDoFQuadAccessor<dim,BaseClass> &a);
+ void copy_from (const MGDoFObjectAccessor<2, dim,BaseClass> &a);
};
* Return a pointer to the #i#th line
* bounding this #Hex#.
*/
- TriaIterator<dim,MGDoFLineAccessor<dim,LineAccessor<dim> > >
+ TriaIterator<dim,MGDoFObjectAccessor<1, dim,TriaObjectAccessor<1, dim> > >
line (const unsigned int i) const;
/**
* Return a pointer to the #i#th quad
* bounding this #Hex#.
*/
- TriaIterator<dim,MGDoFQuadAccessor<dim,QuadAccessor<dim> > >
+ TriaIterator<dim,MGDoFObjectAccessor<2, dim,TriaObjectAccessor<2, dim> > >
quad (const unsigned int i) const;
/**
* the compiler) happens to use this class.
*/
template <int dim>
-class MGDoFSubstructAccessor : public MGDoFLineAccessor<1,CellAccessor<1> > {
+class MGDoFSubstructAccessor : public MGDoFObjectAccessor<1, 1,CellAccessor<1> > {
public:
MGDoFSubstructAccessor () {
Assert (false, ExcInternalError());
* with template parameters. This class and #DoFSubstructAccessor<2>#
* wrap the following names:
* \begin{verbatim}
- * MGDoFSubstructAccessor<1> := MGDoFLineAccessor<1,CellAccessor<1> >;
- * MGDoFSubstructAccessor<2> := MGDoFQuadAccessor<2,CellAccessor<2> >;
+ * MGDoFSubstructAccessor<1> := MGDoFObjectAccessor<1, 1,CellAccessor<1> >;
+ * MGDoFSubstructAccessor<2> := MGDoFObjectAccessor<2, 2,CellAccessor<2> >;
* \end{verbatim}
* We do this rather complex (and needless, provided C++ the needed constructs!)
* class hierarchy manipulation, since this way we can declare and implement
* the \Ref{DoFCellAccessor} dimension independent as an inheritance from
* #DoFSubstructAccessor<dim>#. If we had not declared these
* types, we would have to write two class declarations, one for
- * #DoFCellAccessor<1>#, derived from #DoFLineAccessor<1,CellAccessor<1> >#
+ * #DoFCellAccessor<1>#, derived from #DoFObjectAccessor<1, 1,CellAccessor<1> >#
* and one for #DoFCellAccessor<2>#, derived from
- * #DoFQuadAccessor<2,CellAccessor<2> >#.
+ * #DoFObjectAccessor<2, 2,CellAccessor<2> >#.
*/
template <>
-class MGDoFSubstructAccessor<1> : public MGDoFLineAccessor<1,CellAccessor<1> > {
+class MGDoFSubstructAccessor<1> : public MGDoFObjectAccessor<1, 1,CellAccessor<1> > {
public:
/**
* Declare the data type that this accessor
* class expects to get passed from the
* iterator classes.
*/
- typedef MGDoFLineAccessor<1,CellAccessor<1> >::AccessorData AccessorData;
+ typedef MGDoFObjectAccessor<1, 1,CellAccessor<1> >::AccessorData AccessorData;
/**
* Constructor
const int level,
const int index,
const AccessorData *local_data) :
- MGDoFLineAccessor<1,CellAccessor<1> > (tria,level,index,local_data) {};
+ MGDoFObjectAccessor<1, 1,CellAccessor<1> > (tria,level,index,local_data) {};
// do this here, since this way the
// CellAccessor has the possibility to know
// what a face_iterator is. Otherwise
* @see MGDoFSubstructAccessor<1>
*/
template <>
-class MGDoFSubstructAccessor<2> : public MGDoFQuadAccessor<2,CellAccessor<2> > {
+class MGDoFSubstructAccessor<2> : public MGDoFObjectAccessor<2, 2,CellAccessor<2> > {
public:
/**
* Declare the data type that this accessor
* class expects to get passed from the
* iterator classes.
*/
- typedef MGDoFQuadAccessor<2,CellAccessor<2> >::AccessorData AccessorData;
+ typedef MGDoFObjectAccessor<2, 2,CellAccessor<2> >::AccessorData AccessorData;
/**
* Constructor
const int level,
const int index,
const AccessorData *local_data) :
- MGDoFQuadAccessor<2,CellAccessor<2> > (tria,level,index,local_data) {};
+ MGDoFObjectAccessor<2, 2,CellAccessor<2> > (tria,level,index,local_data) {};
// do this here, since this way the
// CellAccessor has the possibility to know
// what a face_iterator is. Otherwise
// it would have to ask the DoFHandler<dim>
// which would need another big include
// file and maybe cyclic interdependence
- typedef TriaIterator<2,MGDoFLineAccessor<2,LineAccessor<2> > > face_iterator;
+ typedef TriaIterator<2,MGDoFObjectAccessor<1, 2,TriaObjectAccessor<1, 2> > > face_iterator;
};
// it would have to ask the DoFHandler<dim>
// which would need another big include
// file and maybe cyclic interdependence
- typedef TriaIterator<3,MGDoFQuadAccessor<3,QuadAccessor<3> > > face_iterator;
+ typedef TriaIterator<3,MGDoFObjectAccessor<2, 3,TriaObjectAccessor<2, 3> > > face_iterator;
};
/**
* Grant access to the degrees of freedom on a cell. In fact, since all
* access to the degrees of freedom has been enabled by the classes
- * #DoFLineAccessor<1># and #DoFQuadAccessor<2># for the space dimension
+ * #DoFObjectAccessor<1, 1># and #DoFObjectAccessor<2, 2># for the space dimension
* one and two, respectively, this class only collects the pieces
* together by deriving from the appropriate #DoF*Accessor# and the
* right #CellAccessor<dim># and finally adding two functions which give
* of this cell.
*
* This function is not implemented in 1D,
- * and maps to MGDoFQuadAccessor::line in 2D.
+ * and maps to MGDoFObjectAccessor<2, dim>::line in 2D.
*/
typename MGDoFSubstructAccessor<dim>::face_iterator
face (const unsigned int i) const;
*/
class MGDoFDimensionInfo<2> {
public:
- typedef TriaRawIterator<2,MGDoFLineAccessor<2,LineAccessor<2> > > raw_line_iterator;
- typedef TriaIterator<2,MGDoFLineAccessor<2,LineAccessor<2> > > line_iterator;
- typedef TriaActiveIterator<2,MGDoFLineAccessor<2,LineAccessor<2> > > active_line_iterator;
+ typedef TriaRawIterator<2,MGDoFObjectAccessor<1, 2,TriaObjectAccessor<1, 2> > > raw_line_iterator;
+ typedef TriaIterator<2,MGDoFObjectAccessor<1, 2,TriaObjectAccessor<1, 2> > > line_iterator;
+ typedef TriaActiveIterator<2,MGDoFObjectAccessor<1, 2,TriaObjectAccessor<1, 2> > > active_line_iterator;
typedef TriaRawIterator<2,MGDoFCellAccessor<2> > raw_quad_iterator;
typedef TriaIterator<2,MGDoFCellAccessor<2> > quad_iterator;
*/
class MGDoFDimensionInfo<3> {
public:
- typedef TriaRawIterator<3,MGDoFLineAccessor<3,LineAccessor<3> > > raw_line_iterator;
- typedef TriaIterator<3,MGDoFLineAccessor<3,LineAccessor<3> > > line_iterator;
- typedef TriaActiveIterator<3,MGDoFLineAccessor<3,LineAccessor<3> > > active_line_iterator;
+ typedef TriaRawIterator<3,MGDoFObjectAccessor<1, 3,TriaObjectAccessor<1, 3> > > raw_line_iterator;
+ typedef TriaIterator<3,MGDoFObjectAccessor<1, 3,TriaObjectAccessor<1, 3> > > line_iterator;
+ typedef TriaActiveIterator<3,MGDoFObjectAccessor<1, 3,TriaObjectAccessor<1, 3> > > active_line_iterator;
- typedef TriaRawIterator<3,MGDoFQuadAccessor<3,QuadAccessor<3> > > raw_quad_iterator;
- typedef TriaIterator<3,MGDoFQuadAccessor<3,QuadAccessor<3> > > quad_iterator;
- typedef TriaActiveIterator<3,MGDoFQuadAccessor<3,QuadAccessor<3> > > active_quad_iterator;
+ typedef TriaRawIterator<3,MGDoFObjectAccessor<2, 3,TriaObjectAccessor<2, 3> > > raw_quad_iterator;
+ typedef TriaIterator<3,MGDoFObjectAccessor<2, 3,TriaObjectAccessor<2, 3> > > quad_iterator;
+ typedef TriaActiveIterator<3,MGDoFObjectAccessor<2, 3,TriaObjectAccessor<2, 3> > > active_quad_iterator;
typedef TriaRawIterator<3,MGDoFCellAccessor<3> > raw_hex_iterator;
typedef TriaIterator<3,MGDoFCellAccessor<3> > hex_iterator;
*/
/*@{*/
/**
- * Return iterator to the first cell, used
+ * Iterator to the first cell, used
* or not, on level #level#. If a level
* has no cells, a past-the-end iterator
* is returned.
raw_cell_iterator begin_raw (const unsigned int level = 0) const;
/**
- * Return iterator to the first used cell
+ * Iterator to the first used cell
* on level #level#.
*
* This function calls #begin_line#
cell_iterator begin (const unsigned int level = 0) const;
/**
- * Return iterator to the first active
+ * Iterator to the first active
* cell on level #level#.
*
* This function calls #begin_active_line#
active_cell_iterator begin_active(const unsigned int level = 0) const;
/**
- * Return iterator past the end; this
+ * Iterator past the end; this
* iterator serves for comparisons of
* iterators with past-the-end or
* before-the-beginning states.
*/
/*@{*/
/**
- * Return iterator to the first face, used
+ * Iterator to the first face, used
* or not, on level #level#. If a level
* has no faces, a past-the-end iterator
* is returned.
raw_face_iterator begin_raw_face (const unsigned int level = 0) const;
/**
- * Return iterator to the first used face
+ * Iterator to the first used face
* on level #level#.
*
* This function calls #begin_line#
face_iterator begin_face (const unsigned int level = 0) const;
/**
- * Return iterator to the first active
+ * Iterator to the first active
* face on level #level#.
*
* This function calls #begin_active_line#
active_face_iterator begin_active_face(const unsigned int level = 0) const;
/**
- * Return iterator past the end; this
+ * Iterator past the end; this
* iterator serves for comparisons of
* iterators with past-the-end or
* before-the-beginning states.
*/
/*@{*/
/**
- * Return iterator to the first line, used
+ * Iterator to the first line, used
* or not, on level #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;
/**
- * Return iterator to the first used line
+ * Iterator to the first used line
* on level #level#.
*/
line_iterator begin_line (const unsigned int level = 0) const;
/**
- * Return iterator to the first active
+ * Iterator to the first active
* line on level #level#.
*/
active_line_iterator begin_active_line(const unsigned int level = 0) const;
/**
- * Return iterator past the end; this
+ * Iterator past the end; this
* iterator serves for comparisons of
* iterators with past-the-end or
* before-the-beginning states.
/*@{
*/
/**
- * Return iterator to the first quad, used
+ * Iterator to the first quad, used
* or not, on level #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;
/**
- * Return iterator to the first used quad
+ * Iterator to the first used quad
* on level #level#.
*/
quad_iterator begin_quad (const unsigned int level = 0) const;
/**
- * Return iterator to the first active
+ * Iterator to the first active
* quad on level #level#.
*/
active_quad_iterator begin_active_quad(const unsigned int level = 0) const;
/**
- * Return iterator past the end; this
+ * Iterator past the end; this
* iterator serves for comparisons of
* iterators with past-the-end or
* before-the-beginning states.
/*@{
*/
/**
- * Return iterator to the first hex, used
+ * Iterator to the first hex, used
* or not, on level #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;
/**
- * Return iterator to the first used hex
+ * Iterator to the first used hex
* on level #level#.
*/
hex_iterator begin_hex (const unsigned int level = 0) const;
/**
- * Return iterator to the first active
+ * Iterator to the first active
* hex on level #level#.
*/
active_hex_iterator begin_active_hex(const unsigned int level = 0) const;
/**
- * Return iterator past the end; this
+ * Iterator past the end; this
* iterator serves for comparisons of
* iterators with past-the-end or
* before-the-beginning states.
* Exception.
*/
DeclException0 (ExcNoMemory);
- /**
- * Exception.
-
- */
- DeclException0 (ExcInvalidIndex);
/**
* Exception.
*/
*/
vector<unsigned int> mg_used_dofs;
- friend class MGDoFLineAccessor<dim, LineAccessor<dim> >;
- friend class MGDoFLineAccessor<dim, CellAccessor<dim> >;
- friend class MGDoFQuadAccessor<dim, QuadAccessor<dim> >;
- friend class MGDoFQuadAccessor<dim, CellAccessor<dim> >;
+ friend class MGDoFObjectAccessor<1, dim, TriaObjectAccessor<1, dim> >;
+ friend class MGDoFObjectAccessor<1, dim, CellAccessor<dim> >;
+ friend class MGDoFObjectAccessor<2, dim, TriaObjectAccessor<2, dim> >;
+ friend class MGDoFObjectAccessor<2, dim, CellAccessor<dim> >;
friend class MGDoFHexAccessor<dim, HexAccessor<dim> >;
friend class MGDoFHexAccessor<dim, CellAccessor<dim> >;
};
const unsigned int index) {
Assert ((level >= coarsest_level) && (level <= finest_level),
ExcInvalidLevel(level));
- Assert (dof_number < dofs_per_vertex, ExcInvalidIndex ());
+ Assert (dof_number < dofs_per_vertex,
+ ExcIndexRange(dof_number, 0, dofs_per_vertex));
indices[(level-coarsest_level)*dofs_per_vertex + dof_number] = index;
};
const unsigned int dofs_per_vertex) const {
Assert ((level >= coarsest_level) && (level <= finest_level),
ExcInvalidLevel(level));
- Assert (dof_number < dofs_per_vertex, ExcInvalidIndex ());
+ Assert (dof_number < dofs_per_vertex,
+ ExcIndexRange (dof_number, 0, dofs_per_vertex));
return indices[(level-coarsest_level)*dofs_per_vertex + dof_number];
};
const unsigned int face_dofs = dofs->get_fe().dofs_per_face;
d.clear();
- hanging_nodes.condense(src);
+// hanging_nodes.condense(src);
vector<int> index(fe_dofs);
vector<int> mgindex(fe_dofs);
vector<int> mgfaceindex(face_dofs);
- {
- ofstream of("CT");
- DataOut<2> out;
- out.attach_dof_handler(*dofs);
- out.add_data_vector(src,"solution");
- out.write_gnuplot(of,1);
- }
+// {
+// ofstream of("CT");
+// DataOut<2> out;
+// out.attach_dof_handler(*dofs);
+// out.add_data_vector(src,"solution");
+// out.write_gnuplot(of,1);
+// }
for (int level = maxlevel ; level >= (int) minlevel ; --level)
{
DoFHandler<dim>::active_cell_iterator dc = dofs->DoFHandler<dim>::begin_active(level);
MGDoFHandler<dim>::active_cell_iterator c = dofs->begin_active(level);
- for (; c != dofs->end(level) ; ++c, ++dc)
+
+//TODO: Document on difference between #end# and #end_level#
+
+ for (; c != dofs->end_active(level) ; ++c, ++dc)
{
dc->get_dof_indices(index);
c->get_mg_dof_indices(mgindex);
transfer->restrict(level+1, d[level], d[level+1]);
}
- for (unsigned int i=minlevel; i<= maxlevel; ++i)
- {
- char name[10];
- sprintf(name,"CT%d",i);
- ofstream of(name);
- write_gnuplot(*dofs, d[i], i, of);
- }
+// for (unsigned int i=minlevel; i<= maxlevel; ++i)
+// {
+// char name[10];
+// sprintf(name,"CT%d",i);
+// ofstream of(name);
+// write_gnuplot(*dofs, d[i], i, of);
+// }
}
template <int dim> template <typename number>
vector<int> index(fe_dofs);
vector<int> mgindex(fe_dofs);
- for (unsigned int i=minlevel; i<= maxlevel; ++i)
- {
- char name[10];
- sprintf(name,"CF%d",i);
- ofstream of(name);
- write_gnuplot(*dofs, s[i], i, of);
- }
+// for (unsigned int i=minlevel; i<= maxlevel; ++i)
+// {
+// char name[10];
+// sprintf(name,"CF%d",i);
+// ofstream of(name);
+// write_gnuplot(*dofs, s[i], i, of);
+// }
DoFHandler<dim>::active_cell_iterator dc = dofs->DoFHandler<dim>::begin_active();
for (MGDoFHandler<dim>::active_cell_iterator c = dofs->begin_active()
dst(index[i]) = s[c->level()](mgindex[i]);
}
hanging_nodes.set_zero(dst);
- {
- ofstream of("CF");
- DataOut<2> out;
- out.attach_dof_handler(*dofs);
- out.add_data_vector(dst,"solution");
- out.write_gnuplot(of,1);
- }
+// {
+// ofstream of("CF");
+// DataOut<2> out;
+// out.attach_dof_handler(*dofs);
+// out.add_data_vector(dst,"solution");
+// out.write_gnuplot(of,1);
+// }
}
template <int dim>
const unsigned int face_dofs = dofs->get_fe().dofs_per_face;
d.clear();
- hanging_nodes.condense(src);
+// hanging_nodes.condense(src);
vector<int> index(fe_dofs);
vector<int> mgindex(fe_dofs);
vector<int> mgfaceindex(face_dofs);
- {
- ofstream of("CT");
- DataOut<2> out;
- out.attach_dof_handler(*dofs);
- out.add_data_vector(src,"solution");
- out.write_gnuplot(of,1);
- }
+// {
+// ofstream of("CT");
+// DataOut<2> out;
+// out.attach_dof_handler(*dofs);
+// out.add_data_vector(src,"solution");
+// out.write_gnuplot(of,1);
+// }
for (int level = maxlevel ; level >= (int) minlevel ; --level)
{
DoFHandler<dim>::active_cell_iterator dc = dofs->DoFHandler<dim>::begin_active(level);
MGDoFHandler<dim>::active_cell_iterator c = dofs->begin_active(level);
- for (; c != dofs->end(level) ; ++c, ++dc)
+
+//TODO: Document on difference between #end# and #end_level#
+
+ for (; c != dofs->end_active(level) ; ++c, ++dc)
{
dc->get_dof_indices(index);
c->get_mg_dof_indices(mgindex);
transfer->restrict(level+1, d[level], d[level+1]);
}
- for (unsigned int i=minlevel; i<= maxlevel; ++i)
- {
- char name[10];
- sprintf(name,"CT%d",i);
- ofstream of(name);
- write_gnuplot(*dofs, d[i], i, of);
- }
+// for (unsigned int i=minlevel; i<= maxlevel; ++i)
+// {
+// char name[10];
+// sprintf(name,"CT%d",i);
+// ofstream of(name);
+// write_gnuplot(*dofs, d[i], i, of);
+// }
}
template <int dim> template <typename number>
vector<int> index(fe_dofs);
vector<int> mgindex(fe_dofs);
- for (unsigned int i=minlevel; i<= maxlevel; ++i)
- {
- char name[10];
- sprintf(name,"CF%d",i);
- ofstream of(name);
- write_gnuplot(*dofs, s[i], i, of);
- }
+// for (unsigned int i=minlevel; i<= maxlevel; ++i)
+// {
+// char name[10];
+// sprintf(name,"CF%d",i);
+// ofstream of(name);
+// write_gnuplot(*dofs, s[i], i, of);
+// }
DoFHandler<dim>::active_cell_iterator dc = dofs->DoFHandler<dim>::begin_active();
for (MGDoFHandler<dim>::active_cell_iterator c = dofs->begin_active()
dst(index[i]) = s[c->level()](mgindex[i]);
}
hanging_nodes.set_zero(dst);
- {
- ofstream of("CF");
- DataOut<2> out;
- out.attach_dof_handler(*dofs);
- out.add_data_vector(dst,"solution");
- out.write_gnuplot(of,1);
- }
+// {
+// ofstream of("CF");
+// DataOut<2> out;
+// out.attach_dof_handler(*dofs);
+// out.add_data_vector(dst,"solution");
+// out.write_gnuplot(of,1);
+// }
}
template <int dim>
template <int dim, typename BaseClass>
-void DoFLineAccessor<dim,BaseClass>::set_dof_index (const unsigned int i,
+void DoFObjectAccessor<1, dim,BaseClass>::set_dof_index (const unsigned int i,
const int index) const {
Assert (dof_handler != 0, ExcInvalidObject());
// make sure a FE has been selected
template <int dim, typename BaseClass>
-void DoFLineAccessor<dim,BaseClass>::set_vertex_dof_index (const unsigned int vertex,
+void DoFObjectAccessor<1, dim,BaseClass>::set_vertex_dof_index (const unsigned int vertex,
const unsigned int i,
const int index) const {
Assert (dof_handler != 0, ExcInvalidObject());
template <int dim, typename BaseClass>
-void DoFLineAccessor<dim,BaseClass>::
+void DoFObjectAccessor<1, dim,BaseClass>::
distribute_local_to_global (const Vector<double> &local_source,
Vector<double> &global_destination) const {
Assert (dof_handler != 0, ExcInvalidObject());
template <int dim, typename BaseClass>
-void DoFLineAccessor<dim,BaseClass>::
+void DoFObjectAccessor<1, dim,BaseClass>::
distribute_local_to_global (const FullMatrix<double> &local_source,
SparseMatrix<double> &global_destination) const {
Assert (dof_handler != 0, ExcInvalidObject());
template <int dim, typename BaseClass>
-void DoFQuadAccessor<dim,BaseClass>::set_dof_index (const unsigned int i,
+void DoFObjectAccessor<2, dim,BaseClass>::set_dof_index (const unsigned int i,
const int index) const {
Assert (dof_handler != 0, ExcInvalidObject());
// make sure a FE has been selected
template <int dim, typename BaseClass>
-void DoFQuadAccessor<dim,BaseClass>::set_vertex_dof_index (const unsigned int vertex,
+void DoFObjectAccessor<2, dim,BaseClass>::set_vertex_dof_index (const unsigned int vertex,
const unsigned int i,
const int index) const {
Assert (dof_handler != 0, ExcInvalidObject());
template <int dim, typename BaseClass>
-void DoFQuadAccessor<dim,BaseClass>::
+void DoFObjectAccessor<2, dim,BaseClass>::
distribute_local_to_global (const Vector<double> &local_source,
Vector<double> &global_destination) const {
Assert (dof_handler != 0, ExcInvalidObject());
template <int dim, typename BaseClass>
-void DoFQuadAccessor<dim,BaseClass>::
+void DoFObjectAccessor<2, dim,BaseClass>::
distribute_local_to_global (const FullMatrix<double> &local_source,
SparseMatrix<double> &global_destination) const {
Assert (dof_handler != 0, ExcInvalidObject());
#if deal_II_dimension == 1
-template class DoFLineAccessor<1,CellAccessor<1> >;
+template class DoFObjectAccessor<1, 1,CellAccessor<1> >;
template class DoFCellAccessor<1>;
template class TriaRawIterator<1,DoFCellAccessor<1> >;
#endif
#if deal_II_dimension == 2
-template class DoFLineAccessor<2,LineAccessor<2> >;
-template class DoFQuadAccessor<2,QuadAccessor<2> >;
-template class DoFQuadAccessor<2,CellAccessor<2> >;
+template class DoFObjectAccessor<1, 2,TriaObjectAccessor<1, 2> >;
+template class DoFObjectAccessor<2, 2,TriaObjectAccessor<2, 2> >;
+template class DoFObjectAccessor<2, 2,CellAccessor<2> >;
template class DoFCellAccessor<2>;
-template class TriaRawIterator<2,DoFLineAccessor<2,LineAccessor<2> > >;
-template class TriaRawIterator<2,DoFQuadAccessor<2,QuadAccessor<2> > >;
+template class TriaRawIterator<2,DoFObjectAccessor<1, 2,TriaObjectAccessor<1, 2> > >;
+template class TriaRawIterator<2,DoFObjectAccessor<2, 2,TriaObjectAccessor<2, 2> > >;
template class TriaRawIterator<2,DoFCellAccessor<2> >;
-template class TriaIterator<2,DoFLineAccessor<2,LineAccessor<2> > >;
+template class TriaIterator<2,DoFObjectAccessor<1, 2,TriaObjectAccessor<1, 2> > >;
template class TriaIterator<2,DoFCellAccessor<2> >;
-template class TriaActiveIterator<2,DoFLineAccessor<2,LineAccessor<2> > >;
+template class TriaActiveIterator<2,DoFObjectAccessor<1, 2,TriaObjectAccessor<1, 2> > >;
template class TriaActiveIterator<2,DoFCellAccessor<2> >;
#endif
#if deal_II_dimension == 3
-template class DoFLineAccessor<3,LineAccessor<3> >;
-template class DoFQuadAccessor<3,QuadAccessor<3> >;
+template class DoFObjectAccessor<1, 3,TriaObjectAccessor<1, 3> >;
+template class DoFObjectAccessor<2, 3,TriaObjectAccessor<2, 3> >;
template class DoFHexAccessor<3,HexAccessor<3> >;
template class DoFHexAccessor<3,CellAccessor<3> >;
template class DoFCellAccessor<3>;
-template class TriaRawIterator<3,DoFLineAccessor<3,LineAccessor<3> > >;
-template class TriaRawIterator<3,DoFQuadAccessor<3,QuadAccessor<3> > >;
+template class TriaRawIterator<3,DoFObjectAccessor<1, 3,TriaObjectAccessor<1, 3> > >;
+template class TriaRawIterator<3,DoFObjectAccessor<2, 3,TriaObjectAccessor<2, 3> > >;
template class TriaRawIterator<3,DoFHexAccessor<3,HexAccessor<3> > >;
template class TriaRawIterator<3,DoFCellAccessor<3> >;
-template class TriaIterator<3,DoFLineAccessor<3,LineAccessor<3> > >;
-template class TriaIterator<3,DoFQuadAccessor<3,QuadAccessor<3> > >;
+template class TriaIterator<3,DoFObjectAccessor<1, 3,TriaObjectAccessor<1, 3> > >;
+template class TriaIterator<3,DoFObjectAccessor<2, 3,TriaObjectAccessor<2, 3> > >;
template class TriaIterator<3,DoFCellAccessor<3> >;
-template class TriaActiveIterator<3,DoFLineAccessor<3,LineAccessor<3> > >;
-template class TriaActiveIterator<3,DoFQuadAccessor<3,QuadAccessor<3> > >;
+template class TriaActiveIterator<3,DoFObjectAccessor<1, 3,TriaObjectAccessor<1, 3> > >;
+template class TriaActiveIterator<3,DoFObjectAccessor<2, 3,TriaObjectAccessor<2, 3> > >;
template class TriaActiveIterator<3,DoFCellAccessor<3> >;
#endif
/* ------------------------ MGDoFLineAccessor --------------------------- */
template <int dim, typename BaseClass>
-MGDoFLineAccessor<dim,BaseClass>::MGDoFLineAccessor (Triangulation<dim> *tria,
+MGDoFObjectAccessor<1, dim,BaseClass>::MGDoFObjectAccessor (Triangulation<dim> *tria,
const int level,
const int index,
const AccessorData *local_data) :
MGDoFAccessor<dim> (local_data),
- DoFLineAccessor<dim,BaseClass>(tria,level,index,local_data) {};
+ DoFObjectAccessor<1, dim,BaseClass>(tria,level,index,local_data) {};
template <int dim, typename BaseClass>
-int MGDoFLineAccessor<dim,BaseClass>::mg_dof_index (const unsigned int i) const {
+int MGDoFObjectAccessor<1, dim,BaseClass>::mg_dof_index (const unsigned int i) const {
Assert (dof_handler != 0, ExcInvalidObject());
Assert (mg_dof_handler != 0, ExcInvalidObject());
// make sure a FE has been selected
template <int dim, typename BaseClass>
-void MGDoFLineAccessor<dim,BaseClass>::set_mg_dof_index (const unsigned int i,
+void MGDoFObjectAccessor<1, dim,BaseClass>::set_mg_dof_index (const unsigned int i,
const int index) const {
Assert (dof_handler != 0, ExcInvalidObject());
Assert (mg_dof_handler != 0, ExcInvalidObject());
template <int dim, typename BaseClass>
-int MGDoFLineAccessor<dim,BaseClass>::mg_vertex_dof_index (const unsigned int vertex,
+int MGDoFObjectAccessor<1, dim,BaseClass>::mg_vertex_dof_index (const unsigned int vertex,
const unsigned int i) const {
Assert (dof_handler != 0, ExcInvalidObject());
Assert (mg_dof_handler != 0, ExcInvalidObject());
template <int dim, typename BaseClass>
-void MGDoFLineAccessor<dim,BaseClass>::set_mg_vertex_dof_index (const unsigned int vertex,
+void MGDoFObjectAccessor<1, dim,BaseClass>::set_mg_vertex_dof_index (const unsigned int vertex,
const unsigned int i,
const int index) const {
Assert (dof_handler != 0, ExcInvalidObject());
template <int dim, typename BaseClass>
void
-MGDoFLineAccessor<dim,BaseClass>::get_mg_dof_indices (vector<int> &dof_indices) const {
+MGDoFObjectAccessor<1, dim,BaseClass>::get_mg_dof_indices (vector<int> &dof_indices) const {
Assert (dof_handler != 0, ExcInvalidObject());
Assert (mg_dof_handler != 0, ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, ExcInvalidObject());
template <int dim, typename BaseClass>
-TriaIterator<dim,MGDoFLineAccessor<dim,BaseClass> >
-MGDoFLineAccessor<dim,BaseClass>::child (const unsigned int i) const {
- TriaIterator<dim,MGDoFLineAccessor<dim,BaseClass> > q (tria,
+TriaIterator<dim,MGDoFObjectAccessor<1, dim,BaseClass> >
+MGDoFObjectAccessor<1, dim,BaseClass>::child (const unsigned int i) const {
+ TriaIterator<dim,MGDoFObjectAccessor<1, dim,BaseClass> > q (tria,
present_level+1,
child_index (i),
mg_dof_handler);
template <int dim, typename BaseClass>
void
-MGDoFLineAccessor<dim,BaseClass>::copy_from (const MGDoFLineAccessor<dim,BaseClass> &a) {
- DoFLineAccessor<dim,BaseClass>::copy_from (a);
+MGDoFObjectAccessor<1, dim,BaseClass>::copy_from (const MGDoFObjectAccessor<1, dim,BaseClass> &a)
+{
+ DoFObjectAccessor<1, dim,BaseClass>::copy_from (a);
set_mg_dof_handler (a.mg_dof_handler);
};
/* ------------------------ MGDoFQuadAccessor --------------------------- */
template <int dim, typename BaseClass>
-MGDoFQuadAccessor<dim,BaseClass>::MGDoFQuadAccessor (Triangulation<dim> *tria,
+MGDoFObjectAccessor<2, dim,BaseClass>::MGDoFObjectAccessor (Triangulation<dim> *tria,
const int level,
const int index,
const AccessorData *local_data) :
MGDoFAccessor<dim> (local_data),
- DoFQuadAccessor<dim,BaseClass>(tria,level,index,local_data) {};
+ DoFObjectAccessor<2, dim,BaseClass>(tria,level,index,local_data)
+{};
template <int dim, typename BaseClass>
inline
-int MGDoFQuadAccessor<dim,BaseClass>::mg_dof_index (const unsigned int i) const {
+int MGDoFObjectAccessor<2, dim,BaseClass>::mg_dof_index (const unsigned int i) const {
Assert (dof_handler != 0, ExcInvalidObject());
Assert (mg_dof_handler != 0, ExcInvalidObject());
// make sure a FE has been selected
template <int dim, typename BaseClass>
-void MGDoFQuadAccessor<dim,BaseClass>::set_mg_dof_index (const unsigned int i,
+void MGDoFObjectAccessor<2, dim,BaseClass>::set_mg_dof_index (const unsigned int i,
const int index) const {
Assert (dof_handler != 0, ExcInvalidObject());
Assert (mg_dof_handler != 0, ExcInvalidObject());
template <int dim, typename BaseClass>
inline
-int MGDoFQuadAccessor<dim,BaseClass>::mg_vertex_dof_index (const unsigned int vertex,
+int MGDoFObjectAccessor<2, dim,BaseClass>::mg_vertex_dof_index (const unsigned int vertex,
const unsigned int i) const {
Assert (dof_handler != 0, ExcInvalidObject());
Assert (mg_dof_handler != 0, ExcInvalidObject());
template <int dim, typename BaseClass>
-void MGDoFQuadAccessor<dim,BaseClass>::set_mg_vertex_dof_index (const unsigned int vertex,
+void MGDoFObjectAccessor<2, dim,BaseClass>::set_mg_vertex_dof_index (const unsigned int vertex,
const unsigned int i,
const int index) const {
Assert (dof_handler != 0, ExcInvalidObject());
template <int dim, typename BaseClass>
void
-MGDoFQuadAccessor<dim,BaseClass>::get_mg_dof_indices (vector<int> &dof_indices) const {
+MGDoFObjectAccessor<2, dim,BaseClass>::get_mg_dof_indices (vector<int> &dof_indices) const {
Assert (dof_handler != 0, ExcInvalidObject());
Assert (mg_dof_handler != 0, ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, ExcInvalidObject());
template <int dim, typename BaseClass>
-TriaIterator<dim,MGDoFLineAccessor<dim,LineAccessor<dim> > >
-MGDoFQuadAccessor<dim,BaseClass>::line (const unsigned int i) const {
+TriaIterator<dim,MGDoFObjectAccessor<1, dim,TriaObjectAccessor<1, dim> > >
+MGDoFObjectAccessor<2, dim,BaseClass>::line (const unsigned int i) const {
Assert (i<4, ExcIndexRange (i, 0, 4));
- return TriaIterator<dim,MGDoFLineAccessor<dim,LineAccessor<dim> > >
+ return TriaIterator<dim,MGDoFObjectAccessor<1, dim,TriaObjectAccessor<1, dim> > >
(
tria,
present_level,
template <int dim, typename BaseClass>
-TriaIterator<dim,MGDoFQuadAccessor<dim,BaseClass> >
-MGDoFQuadAccessor<dim,BaseClass>::child (const unsigned int i) const {
- TriaIterator<dim,MGDoFQuadAccessor<dim,BaseClass> > q (tria,
+TriaIterator<dim,MGDoFObjectAccessor<2, dim,BaseClass> >
+MGDoFObjectAccessor<2, dim,BaseClass>::child (const unsigned int i) const {
+ TriaIterator<dim,MGDoFObjectAccessor<2, dim,BaseClass> > q (tria,
present_level+1,
child_index (i),
mg_dof_handler);
template <int dim, typename BaseClass>
void
-MGDoFQuadAccessor<dim,BaseClass>::copy_from (const MGDoFQuadAccessor<dim,BaseClass> &a) {
- DoFQuadAccessor<dim,BaseClass>::copy_from (a);
+MGDoFObjectAccessor<2, dim,BaseClass>::copy_from (const MGDoFObjectAccessor<2, dim,BaseClass> &a) {
+ DoFObjectAccessor<2, dim,BaseClass>::copy_from (a);
set_mg_dof_handler (a.mg_dof_handler);
};
template <int dim, typename BaseClass>
-TriaIterator<dim,MGDoFLineAccessor<dim,LineAccessor<dim> > >
+TriaIterator<dim,MGDoFObjectAccessor<1, dim,TriaObjectAccessor<1, dim> > >
MGDoFHexAccessor<dim,BaseClass>::line (const unsigned int i) const {
Assert (i<12, ExcIndexRange (i, 0, 12));
- return TriaIterator<dim,MGDoFLineAccessor<dim,LineAccessor<dim> > >
+ return TriaIterator<dim,MGDoFObjectAccessor<1, dim,TriaObjectAccessor<1, dim> > >
(
tria,
present_level,
template <int dim, typename BaseClass>
-TriaIterator<dim,MGDoFQuadAccessor<dim,QuadAccessor<dim> > >
+TriaIterator<dim,MGDoFObjectAccessor<2, dim,TriaObjectAccessor<2, dim> > >
MGDoFHexAccessor<dim,BaseClass>::quad (const unsigned int i) const {
Assert (i<12, ExcIndexRange (i, 0, 6));
- return TriaIterator<dim,MGDoFQuadAccessor<dim,QuadAccessor<dim> > >
+ return TriaIterator<dim,MGDoFObjectAccessor<2, dim,TriaObjectAccessor<2, dim> > >
(
tria,
present_level,
// explicit instantiations
#if deal_II_dimension == 1
-template class MGDoFLineAccessor<1,CellAccessor<1> >;
+template class MGDoFObjectAccessor<1, 1,CellAccessor<1> >;
template class MGDoFCellAccessor<1>;
template class TriaRawIterator<1,MGDoFCellAccessor<1> >;
#endif
#if deal_II_dimension == 2
-template class MGDoFLineAccessor<2,LineAccessor<2> >;
-template class MGDoFQuadAccessor<2,QuadAccessor<2> >;
-template class MGDoFQuadAccessor<2,CellAccessor<2> >;
+template class MGDoFObjectAccessor<1, 2,TriaObjectAccessor<1, 2> >;
+template class MGDoFObjectAccessor<2, 2,TriaObjectAccessor<2, 2> >;
+template class MGDoFObjectAccessor<2, 2,CellAccessor<2> >;
template class MGDoFCellAccessor<2>;
-template class TriaRawIterator<2,MGDoFLineAccessor<2,LineAccessor<2> > >;
+template class TriaRawIterator<2,MGDoFObjectAccessor<1, 2,TriaObjectAccessor<1, 2> > >;
template class TriaRawIterator<2,MGDoFCellAccessor<2> >;
-template class TriaIterator<2,MGDoFLineAccessor<2,LineAccessor<2> > >;
+template class TriaIterator<2,MGDoFObjectAccessor<1, 2,TriaObjectAccessor<1, 2> > >;
template class TriaIterator<2,MGDoFCellAccessor<2> >;
-template class TriaActiveIterator<2,MGDoFLineAccessor<2,LineAccessor<2> > >;
+template class TriaActiveIterator<2,MGDoFObjectAccessor<1, 2,TriaObjectAccessor<1, 2> > >;
template class TriaActiveIterator<2,MGDoFCellAccessor<2> >;
#endif
#if deal_II_dimension == 3
-template class MGDoFLineAccessor<3,LineAccessor<3> >;
-template class MGDoFQuadAccessor<3,QuadAccessor<3> >;
+template class MGDoFObjectAccessor<1, 3,TriaObjectAccessor<1, 3> >;
+template class MGDoFObjectAccessor<2, 3,TriaObjectAccessor<2, 3> >;
template class MGDoFHexAccessor<3,HexAccessor<3> >;
template class MGDoFHexAccessor<3,CellAccessor<3> >;
template class MGDoFCellAccessor<3>;
-template class TriaRawIterator<3,MGDoFLineAccessor<3,LineAccessor<3> > >;
-template class TriaRawIterator<3,MGDoFQuadAccessor<3,QuadAccessor<3> > >;
+template class TriaRawIterator<3,MGDoFObjectAccessor<1, 3,TriaObjectAccessor<1, 3> > >;
+template class TriaRawIterator<3,MGDoFObjectAccessor<2, 3,TriaObjectAccessor<2, 3> > >;
template class TriaRawIterator<3,MGDoFHexAccessor<3,HexAccessor<3> > >;
template class TriaRawIterator<3,MGDoFCellAccessor<3> >;
-template class TriaIterator<3,MGDoFLineAccessor<3,LineAccessor<3> > >;
-template class TriaIterator<3,MGDoFQuadAccessor<3,QuadAccessor<3> > >;
+template class TriaIterator<3,MGDoFObjectAccessor<1, 3,TriaObjectAccessor<1, 3> > >;
+template class TriaIterator<3,MGDoFObjectAccessor<2, 3,TriaObjectAccessor<2, 3> > >;
template class TriaIterator<3,MGDoFCellAccessor<3> >;
-template class TriaActiveIterator<3,MGDoFLineAccessor<3,LineAccessor<3> > >;
-template class TriaActiveIterator<3,MGDoFQuadAccessor<3,QuadAccessor<3> > >;
+template class TriaActiveIterator<3,MGDoFObjectAccessor<1, 3,TriaObjectAccessor<1, 3> > >;
+template class TriaActiveIterator<3,MGDoFObjectAccessor<2, 3,TriaObjectAccessor<2, 3> > >;
template class TriaActiveIterator<3,MGDoFCellAccessor<3> >;
#endif
template <int dim>
const FullMatrix<double> &
-FiniteElementBase<dim>::restrict (const unsigned int child) const {
- Assert (child<GeometryInfo<dim>::children_per_cell, ExcInvalidIndex(child));
+FiniteElementBase<dim>::restrict (const unsigned int child) const
+{
+ Assert (child<GeometryInfo<dim>::children_per_cell,
+ ExcIndexRange(child, 0, GeometryInfo<dim>::children_per_cell));
return restriction[child];
};
template <int dim>
const FullMatrix<double> &
-FiniteElementBase<dim>::prolongate (const unsigned int child) const {
- Assert (child<GeometryInfo<dim>::children_per_cell, ExcInvalidIndex(child));
+FiniteElementBase<dim>::prolongate (const unsigned int child) const
+{
+ Assert (child<GeometryInfo<dim>::children_per_cell,
+ ExcIndexRange(child, 0, GeometryInfo<dim>::children_per_cell));
return prolongation[child];
};
template <int dim>
const FullMatrix<double> &
-FiniteElementBase<dim>::constraints () const {
+FiniteElementBase<dim>::constraints () const
+{
if (dim==1)
Assert ((interface_constraints.m()==1) && (interface_constraints.n()==1),
ExcWrongInterfaceMatrixSize(interface_constraints.m(),
template <>
inline
double FECrissCross<2>::shape_value (const unsigned int i,
- const Point<2> &p) const {
- Assert((i<total_dofs), ExcInvalidIndex(i));
+ const Point<2> &p) const
+{
+ Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
const double x = p(0),
y = p(1);
template <>
inline
-Tensor<1,2> FECrissCross<2>::shape_grad (const unsigned int i, const Point<2> &p) const {
- Assert((i<total_dofs), ExcInvalidIndex(i));
+Tensor<1,2> FECrissCross<2>::shape_grad (const unsigned int i, const Point<2> &p) const
+{
+ Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
const double x = p(0),
y = p(1);
FECrissCross<2>::shape_grad_grad (const unsigned int i,
const Point<2> &) const
{
- Assert((i<total_dofs), ExcInvalidIndex(i));
+ Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
// second derivatives on the unit cell
// are always zero, at least almost
// everywhere. see the doc for more
FEQ3<1>::shape_value (const unsigned int i,
const Point<1> &p) const
{
- Assert((i<total_dofs), ExcInvalidIndex(i));
+ Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
const double xi = p(0);
switch (i)
{
FEQ3<1>::shape_grad (const unsigned int i,
const Point<1> &p) const
{
- Assert((i<total_dofs), ExcInvalidIndex(i));
+ Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
const double xi = p(0);
// originally, the return type of the
// function was Point<dim>, so we
FEQ3<1>::shape_grad_grad (const unsigned int i,
const Point<1> &p) const
{
- Assert (i<total_dofs, ExcInvalidIndex(i));
+ Assert (i<total_dofs, ExcIndexRange(i, 0, total_dofs));
const double xi = p(0);
Tensor<2,1> return_value;
FEQ3<2>::shape_value (const unsigned int i,
const Point<2> &p) const
{
- Assert (i<total_dofs, ExcInvalidIndex(i));
+ Assert (i<total_dofs, ExcIndexRange(i, 0, total_dofs));
const double xi = p(0),
eta= p(1);
FEQ3<2>::shape_grad (const unsigned int i,
const Point<2> &p) const
{
- Assert (i<total_dofs, ExcInvalidIndex(i));
+ Assert (i<total_dofs, ExcIndexRange(i, 0, total_dofs));
const double xi = p(0),
eta= p(1);
FEQ3<2>::shape_grad_grad (const unsigned int i,
const Point<2> &p) const
{
- Assert (i<total_dofs, ExcInvalidIndex(i));
+ Assert (i<total_dofs, ExcIndexRange(i, 0, total_dofs));
const double xi = p(0),
eta= p(1);
FEQ3<3>::shape_value (const unsigned int i,
const Point<3> &p) const
{
- Assert (i<total_dofs, ExcInvalidIndex(i));
+ Assert (i<total_dofs, ExcIndexRange(i, 0, total_dofs));
const double xi = p(0),
eta = p(1),
FEQ3<3>::shape_grad (const unsigned int i,
const Point<3> &p) const
{
- Assert (i<total_dofs, ExcInvalidIndex(i));
+ Assert (i<total_dofs, ExcIndexRange(i, 0, total_dofs));
const double xi = p(0),
eta = p(1),
FEQ3<3>::shape_grad_grad (const unsigned int i,
const Point<3> &p) const
{
- Assert (i<total_dofs, ExcInvalidIndex(i));
+ Assert (i<total_dofs, ExcIndexRange(i, 0, total_dofs));
const double xi = p(0),
eta = p(1),
FEQ1<1>::shape_value(const unsigned int i,
const Point<1> &p) const
{
- Assert((i<total_dofs), ExcInvalidIndex(i));
+ Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
switch (i)
{
case 0: return 1.-p(0);
FEQ1<1>::shape_grad(const unsigned int i,
const Point<1>&) const
{
- Assert((i<total_dofs), ExcInvalidIndex(i));
+ Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
// originally, the return type of the
// function was Point<dim>, so we
// still construct it as that. it should
FEQ1<1>::shape_grad_grad (const unsigned int i,
const Point<1> &) const
{
- Assert((i<total_dofs), ExcInvalidIndex(i));
+ Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
// second derivatives on the unit cell
// are always zero
return Tensor<2,1>();
FEQ1<2>::shape_value (const unsigned int i,
const Point<2>& p) const
{
- Assert((i<total_dofs), ExcInvalidIndex(i));
+ Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
switch (i)
{
case 0: return (1.-p(0)) * (1.-p(1));
FEQ1<2>::shape_grad (const unsigned int i,
const Point<2>& p) const
{
- Assert((i<total_dofs), ExcInvalidIndex(i));
+ Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
// originally, the return type of the
// function was Point<dim>, so we
// still construct it as that. it should
FEQ1<2>::shape_grad_grad (const unsigned int i,
const Point<2> &) const
{
- Assert((i<total_dofs), ExcInvalidIndex(i));
+ Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
switch (i)
{
FEQ1<3>::shape_value (const unsigned int i,
const Point<3>& p) const
{
- Assert((i<total_dofs), ExcInvalidIndex(i));
+ Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
switch (i)
{
case 0: return 1.0-p(0)+(-1.0+p(0))*p(1)+(-1.0+p(0)+(1.0-p(0))*p(1))*p(2);
FEQ1<3>::shape_grad (const unsigned int i,
const Point<3>& p) const
{
- Assert((i<total_dofs), ExcInvalidIndex(i));
+ Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
// originally, the return type of the
// function was Point<dim>, so we
// still construct it as that. it should
FEQ1<3>::shape_grad_grad (const unsigned int i,
const Point<3> &p) const
{
- Assert((i<total_dofs), ExcInvalidIndex(i));
+ Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
Tensor<2,3> return_value;
FEQ2<1>::shape_value(const unsigned int i,
const Point<1> &p) const
{
- Assert((i<total_dofs), ExcInvalidIndex(i));
+ Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
const double xi = p(0);
switch (i)
{
FEQ2<1>::shape_grad(const unsigned int i,
const Point<1> &p) const
{
- Assert((i<total_dofs), ExcInvalidIndex(i));
+ Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
const double xi = p(0);
// originally, the return type of the
// function was Point<dim>, so we
FEQ2<1>::shape_grad_grad (const unsigned int i,
const Point<1> &) const
{
- Assert((i<total_dofs), ExcInvalidIndex(i));
+ Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
Tensor<2,1> return_value;
switch (i)
FEQ2<2>::shape_value (const unsigned int i,
const Point<2> &p) const
{
- Assert (i<total_dofs, ExcInvalidIndex(i));
+ Assert (i<total_dofs, ExcIndexRange(i, 0, total_dofs));
const double xi = p(0),
eta= p(1);
FEQ2<2>::shape_grad (const unsigned int i,
const Point<2> &p) const
{
- Assert (i<total_dofs, ExcInvalidIndex(i));
+ Assert (i<total_dofs, ExcIndexRange(i, 0, total_dofs));
const double xi = p(0),
eta= p(1);
FEQ2<2>::shape_grad_grad (const unsigned int i,
const Point<2> &p) const
{
- Assert (i<total_dofs, ExcInvalidIndex(i));
+ Assert (i<total_dofs, ExcIndexRange(i, 0, total_dofs));
const double xi = p(0),
eta= p(1);
FEQ2<3>::shape_value (const unsigned int i,
const Point<3> &p) const
{
- Assert (i<total_dofs, ExcInvalidIndex(i));
+ Assert (i<total_dofs, ExcIndexRange(i, 0, total_dofs));
const double xi = p(0),
eta = p(1),
FEQ2<3>::shape_grad (const unsigned int i,
const Point<3> &p) const
{
- Assert (i<total_dofs, ExcInvalidIndex(i));
+ Assert (i<total_dofs, ExcIndexRange(i, 0, total_dofs));
const double xi = p(0),
eta = p(1),
FEQ2<3>::shape_grad_grad (const unsigned int i,
const Point<3> &p) const
{
- Assert (i<total_dofs, ExcInvalidIndex(i));
+ Assert (i<total_dofs, ExcIndexRange(i, 0, total_dofs));
const double xi = p(0),
eta = p(1),
FEQ4<1>::shape_value(const unsigned int i,
const Point<1> &p) const
{
- Assert((i<total_dofs), ExcInvalidIndex(i));
+ Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
const double xi = p(0);
switch (i)
{
FEQ4<1>::shape_grad(const unsigned int i,
const Point<1> &p) const
{
- Assert((i<total_dofs), ExcInvalidIndex(i));
+ Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
const double xi = p(0);
// originally, the return type of the
// function was Point<dim>, so we
FEQ4<1>::shape_grad_grad (const unsigned int i,
const Point<1> &p) const
{
- Assert (i<total_dofs, ExcInvalidIndex(i));
+ Assert (i<total_dofs, ExcIndexRange(i, 0, total_dofs));
const double xi = p(0);
Tensor<2,1> return_value;
FEQ4<2>::shape_value (const unsigned int i,
const Point<2> &p) const
{
- Assert (i<total_dofs, ExcInvalidIndex(i));
+ Assert (i<total_dofs, ExcIndexRange(i, 0, total_dofs));
const double xi = p(0),
eta= p(1);
FEQ4<2>::shape_grad (const unsigned int i,
const Point<2> &p) const
{
- Assert (i<total_dofs, ExcInvalidIndex(i));
+ Assert (i<total_dofs, ExcIndexRange(i, 0, total_dofs));
const double xi = p(0),
eta= p(1);
FEQ4<2>::shape_grad_grad (const unsigned int i,
const Point<2> &p) const
{
- Assert (i<total_dofs, ExcInvalidIndex(i));
+ Assert (i<total_dofs, ExcIndexRange(i, 0, total_dofs));
const double xi = p(0),
eta= p(1);
Assert (fe->n_components == 1,
ExcWrongNoOfComponents());
Assert (selected_dataset<shape_values.size(),
- ExcInvalidIndex (selected_dataset, shape_values.size()));
+ ExcIndexRange (selected_dataset, 0, shape_values.size()));
Assert (values.size() == n_quadrature_points,
ExcWrongVectorSize(values.size(), n_quadrature_points));
Assert (n_quadrature_points == values.size(),
ExcWrongVectorSize(values.size(), n_quadrature_points));
Assert (selected_dataset<shape_values.size(),
- ExcInvalidIndex (selected_dataset, shape_values.size()));
+ ExcIndexRange (selected_dataset, 0, shape_values.size()));
for (unsigned i=0;i<values.size();++i)
Assert (values[i].size() == fe->n_components,
ExcWrongNoOfComponents());
const unsigned int j) const
{
Assert (i<shape_gradients.size(),
- ExcInvalidIndex (i, shape_gradients.size()));
+ ExcIndexRange (i, 0, shape_gradients.size()));
Assert (j<shape_gradients[i].size(),
- ExcInvalidIndex (j, shape_gradients[i].size()));
+ ExcIndexRange (j, 0, shape_gradients[i].size()));
Assert (update_flags & update_gradients, ExcAccessToUninitializedField());
return shape_gradients[i][j];
Assert (n_quadrature_points == gradients.size(),
ExcWrongNoOfComponents());
Assert (selected_dataset<shape_values.size(),
- ExcInvalidIndex (selected_dataset, shape_values.size()));
+ ExcIndexRange (selected_dataset, 0, shape_values.size()));
for (unsigned i=0;i<gradients.size();++i)
Assert (gradients[i].size() == fe->n_components,
ExcWrongVectorSize(gradients.size(), n_quadrature_points));
FEValuesBase<dim>::shape_2nd_derivative (const unsigned int i,
const unsigned int j) const {
Assert (i<shape_2nd_derivatives.size(),
- ExcInvalidIndex (i, shape_2nd_derivatives.size()));
+ ExcIndexRange (i, 0, shape_2nd_derivatives.size()));
Assert (j<shape_2nd_derivatives[i].size(),
- ExcInvalidIndex (j, shape_2nd_derivatives[i].size()));
+ ExcIndexRange (j, 0, shape_2nd_derivatives[i].size()));
Assert (update_flags & update_second_derivatives, ExcAccessToUninitializedField());
return shape_2nd_derivatives[i][j];
template <int dim>
const Point<dim> &
-FEValuesBase<dim>::quadrature_point (const unsigned int i) const {
- Assert (i<quadrature_points.size(), ExcInvalidIndex(i,quadrature_points.size()));
+FEValuesBase<dim>::quadrature_point (const unsigned int i) const
+{
+ Assert (i<quadrature_points.size(), ExcIndexRange(i, 0, quadrature_points.size()));
Assert (update_flags & update_q_points, ExcAccessToUninitializedField());
return quadrature_points[i];
template <int dim>
const Point<dim> &
-FEValuesBase<dim>::support_point (const unsigned int i) const {
- Assert (i<support_points.size(), ExcInvalidIndex(i, support_points.size()));
+FEValuesBase<dim>::support_point (const unsigned int i) const
+{
+ Assert (i<support_points.size(), ExcIndexRange(i, 0, support_points.size()));
Assert (update_flags & update_support_points, ExcAccessToUninitializedField());
return support_points[i];
template <int dim>
-double FEValuesBase<dim>::JxW (const unsigned int i) const {
- Assert (i<JxW_values.size(), ExcInvalidIndex(i, JxW_values.size()));
+double FEValuesBase<dim>::JxW (const unsigned int i) const
+{
+ Assert (i<JxW_values.size(), ExcIndexRange(i, 0, JxW_values.size()));
Assert (update_flags & update_JxW_values, ExcAccessToUninitializedField());
return JxW_values[i];
FEQ1Mapping<1>::shape_value_transform (const unsigned int i,
const Point<1> &p) const
{
- Assert((i<2), ExcInvalidIndex(i));
+ Assert((i<2), ExcIndexRange(i,0,2));
const double xi = p(0);
switch (i)
{
FEQ1Mapping<1>::shape_grad_transform(const unsigned int i,
const Point<1>&) const
{
- Assert((i<2), ExcInvalidIndex(i));
+ Assert((i<2), ExcIndexRange(i,0,2));
switch (i)
{
case 0: return Point<1>(-1.);
FEQ1Mapping<2>::shape_value_transform (const unsigned int i,
const Point<2>& p) const
{
- Assert((i<4), ExcInvalidIndex(i));
+ Assert((i<4), ExcIndexRange(i,0,4));
switch (i)
{
case 0: return (1.-p(0)) * (1.-p(1));
FEQ1Mapping<2>::shape_grad_transform (const unsigned int i,
const Point<2>& p) const
{
- Assert((i<4), ExcInvalidIndex(i));
+ Assert((i<4), ExcIndexRange(i,0,4));
switch (i)
{
case 0: return Point<2> (p(1)-1., p(0)-1.);
FEQ1Mapping<3>::shape_value_transform (const unsigned int i,
const Point<3>& p) const
{
- Assert((i<8), ExcInvalidIndex(i));
+ Assert((i<8), ExcIndexRange(i,0,8));
switch (i)
{
case 0: return 1.0-p(0)+(-1.0+p(0))*p(1)+(-1.0+p(0)+(1.0-p(0))*p(1))*p(2);
FEQ1Mapping<3>::shape_grad_transform (const unsigned int i,
const Point<3>& p) const
{
- Assert((i<8), ExcInvalidIndex(i));
+ Assert((i<8), ExcIndexRange(i,0,8));
switch (i)
{
case 0: return Point<3>(-1.0+p(1)+(1.0-p(1))*p(2),
/*------------------------ Functions: LineAccessor ---------------------------*/
template <int dim>
-void LineAccessor<dim>::set (const Line &line) const {
+void TriaObjectAccessor<1, dim>::set (const Line &line) const {
tria->levels[present_level]->lines.lines[present_index] = line;
};
template <int dim>
-int LineAccessor<dim>::vertex_index (const unsigned int i) const {
+int TriaObjectAccessor<1, dim>::vertex_index (const unsigned int i) const {
Assert (i<2, ExcIndexRange(i,0,2));
return tria->levels[present_level]->lines.lines[present_index].vertex (i);
};
template <int dim>
Point<dim> &
-LineAccessor<dim>::vertex (const unsigned int i) const {
+TriaObjectAccessor<1, dim>::vertex (const unsigned int i) const {
return tria->vertices[vertex_index(i)];
};
template <int dim>
-void LineAccessor<dim>::set_used_flag () const {
+void TriaObjectAccessor<1, dim>::set_used_flag () const {
Assert (state() == valid, ExcDereferenceInvalidObject());
tria->levels[present_level]->lines.used[present_index] = true;
};
template <int dim>
-void LineAccessor<dim>::clear_used_flag () const {
+void TriaObjectAccessor<1, dim>::clear_used_flag () const {
Assert (state() == valid, ExcDereferenceInvalidObject());
tria->levels[present_level]->lines.used[present_index] = false;
};
template <int dim>
-void LineAccessor<dim>::recursively_set_user_flag () const {
+void TriaObjectAccessor<1, dim>::recursively_set_user_flag () const {
set_user_flag ();
if (has_children())
template <int dim>
-void LineAccessor<dim>::recursively_clear_user_flag () const {
+void TriaObjectAccessor<1, dim>::recursively_clear_user_flag () const {
clear_user_flag ();
if (has_children())
template <int dim>
-void LineAccessor<dim>::set_user_pointer (void *p) const {
+void TriaObjectAccessor<1, dim>::set_user_pointer (void *p) const {
Assert (used(), ExcCellNotUsed());
tria->levels[present_level]->lines.user_pointers[present_index] = p;
};
template <int dim>
-void LineAccessor<dim>::clear_user_pointer () const {
+void TriaObjectAccessor<1, dim>::clear_user_pointer () const {
Assert (used(), ExcCellNotUsed());
tria->levels[present_level]->lines.user_pointers[present_index] = 0;
};
template <int dim>
-void * LineAccessor<dim>::user_pointer () const {
+void * TriaObjectAccessor<1, dim>::user_pointer () const {
Assert (used(), ExcCellNotUsed());
return tria->levels[present_level]->lines.user_pointers[present_index];
};
template <int dim>
-void LineAccessor<dim>::set_children (const int index) const {
+void TriaObjectAccessor<1, dim>::set_children (const int index) const {
Assert (used(), ExcCellNotUsed());
Assert ((index==-1) ||
(!has_children() && (index>=0)), ExcCantSetChildren(index));
template <int dim>
-void LineAccessor<dim>::clear_children () const {
+void TriaObjectAccessor<1, dim>::clear_children () const {
set_children (-1);
};
template <int dim>
-unsigned char LineAccessor<dim>::boundary_indicator () const {
+unsigned char TriaObjectAccessor<1, dim>::boundary_indicator () const {
Assert (dim>=2, ExcNotUsefulForThisDimension());
Assert (used(), ExcCellNotUsed());
template <int dim>
-void LineAccessor<dim>::set_boundary_indicator (unsigned char boundary_ind) const {
+void TriaObjectAccessor<1, dim>::set_boundary_indicator (unsigned char boundary_ind) const {
Assert (dim>=2, ExcNotUsefulForThisDimension());
Assert (used(), ExcCellNotUsed());
template <int dim>
-bool LineAccessor<dim>::at_boundary () const {
+bool TriaObjectAccessor<1, dim>::at_boundary () const {
// error checking is done
// in boundary_indicator()
return (boundary_indicator() != 255);
template <int dim>
-double LineAccessor<dim>::diameter () const {
+double TriaObjectAccessor<1, dim>::diameter () const {
return sqrt((vertex(1)-vertex(0)).square());
};
template <int dim>
-Point<dim> LineAccessor<dim>::center () const {
+Point<dim> TriaObjectAccessor<1, dim>::center () const {
return (vertex(1)+vertex(0))/2.;
};
template <int dim>
-Point<dim> LineAccessor<dim>::barycenter () const {
+Point<dim> TriaObjectAccessor<1, dim>::barycenter () const {
return (vertex(1)+vertex(0))/2.;
};
template <int dim>
-double LineAccessor<dim>::measure () const {
+double TriaObjectAccessor<1, dim>::measure () const {
return sqrt((vertex(1)-vertex(0)).square());
};
template <int dim>
-unsigned int LineAccessor<dim>::number_of_children () const {
+unsigned int TriaObjectAccessor<1, dim>::number_of_children () const {
if (!has_children())
return 1;
else
/*------------------------ Functions: QuadAccessor ---------------------------*/
template <int dim>
-void QuadAccessor<dim>::set (const Quad &quad) const {
+void TriaObjectAccessor<2, dim>::set (const Quad &quad) const {
tria->levels[present_level]->quads.quads[present_index] = quad;
};
template <int dim>
-int QuadAccessor<dim>::vertex_index (const unsigned int corner) const {
+int TriaObjectAccessor<2, dim>::vertex_index (const unsigned int corner) const {
Assert (corner<4, ExcIndexRange(corner,0,4));
const int corner_convention[4] = { 0,0,1,1 };
template <int dim>
Point<dim> &
-QuadAccessor<dim>::vertex (const unsigned int i) const {
+TriaObjectAccessor<2, dim>::vertex (const unsigned int i) const {
return tria->vertices[vertex_index(i)];
};
template <int dim>
void
-QuadAccessor<dim>::set_used_flag () const {
+TriaObjectAccessor<2, dim>::set_used_flag () const {
Assert (state() == valid, ExcDereferenceInvalidObject());
tria->levels[present_level]->quads.used[present_index] = true;
};
template <int dim>
-void QuadAccessor<dim>::clear_used_flag () const {
+void TriaObjectAccessor<2, dim>::clear_used_flag () const {
Assert (state() == valid, ExcDereferenceInvalidObject());
tria->levels[present_level]->quads.used[present_index] = false;
};
template <int dim>
-void QuadAccessor<dim>::recursively_set_user_flag () const {
+void TriaObjectAccessor<2, dim>::recursively_set_user_flag () const {
set_user_flag ();
if (has_children())
template <int dim>
-void QuadAccessor<dim>::recursively_clear_user_flag () const {
+void TriaObjectAccessor<2, dim>::recursively_clear_user_flag () const {
clear_user_flag ();
if (has_children())
template <int dim>
-void QuadAccessor<dim>::set_user_pointer (void *p) const {
+void TriaObjectAccessor<2, dim>::set_user_pointer (void *p) const {
Assert (used(), ExcCellNotUsed());
tria->levels[present_level]->quads.user_pointers[present_index] = p;
};
template <int dim>
-void QuadAccessor<dim>::clear_user_pointer () const {
+void TriaObjectAccessor<2, dim>::clear_user_pointer () const {
Assert (used(), ExcCellNotUsed());
tria->levels[present_level]->quads.user_pointers[present_index] = 0;
};
template <int dim>
-void * QuadAccessor<dim>::user_pointer () const {
+void * TriaObjectAccessor<2, dim>::user_pointer () const {
Assert (used(), ExcCellNotUsed());
return tria->levels[present_level]->quads.user_pointers[present_index];
};
template <int dim>
-void QuadAccessor<dim>::set_children (const int index) const {
+void TriaObjectAccessor<2, dim>::set_children (const int index) const {
Assert (used(), ExcCellNotUsed());
Assert ((index==-1) ||
(!has_children() && (index>=0)), ExcCantSetChildren(index));
template <int dim>
-void QuadAccessor<dim>::clear_children () const {
+void TriaObjectAccessor<2, dim>::clear_children () const {
set_children (-1);
};
template <int dim>
-unsigned char QuadAccessor<dim>::boundary_indicator () const {
+unsigned char TriaObjectAccessor<2, dim>::boundary_indicator () const {
Assert (dim>=3, ExcNotUsefulForThisDimension());
Assert (used(), ExcCellNotUsed());
template <int dim>
-void QuadAccessor<dim>::set_boundary_indicator (unsigned char boundary_ind) const {
+void TriaObjectAccessor<2, dim>::set_boundary_indicator (unsigned char boundary_ind) const {
Assert (dim>=3, ExcNotUsefulForThisDimension());
Assert (used(), ExcCellNotUsed());
template <int dim>
-bool QuadAccessor<dim>::at_boundary () const {
+bool TriaObjectAccessor<2, dim>::at_boundary () const {
// error checking is done
// in boundary_indicator()
return (boundary_indicator() != 255);
template <int dim>
-double QuadAccessor<dim>::diameter () const {
+double TriaObjectAccessor<2, dim>::diameter () const {
return sqrt(max((vertex(2)-vertex(0)).square(),
(vertex(3)-vertex(1)).square()));
};
template <int dim>
-Point<dim> QuadAccessor<dim>::center () const {
+Point<dim> TriaObjectAccessor<2, dim>::center () const {
return (vertex(0)+vertex(1)+vertex(2)+vertex(3))/4.;
};
#if deal_II_dimension == 2
template <>
-Point<2> QuadAccessor<2>::barycenter () const {
+Point<2> TriaObjectAccessor<2, 2>::barycenter () const {
// the evaluation of the formulae
// is a bit tricky when done dimension
// independant, so we write this function
template <>
-double QuadAccessor<2>::measure () const {
+double TriaObjectAccessor<2, 2>::measure () const {
// the evaluation of the formulae
// is a bit tricky when done dimension
// independant, so we write this function
#if deal_II_dimension == 3
template <>
-Point<3> QuadAccessor<3>::barycenter () const {
+Point<3> TriaObjectAccessor<2, 3>::barycenter () const {
// the evaluation of the formulae
// is a bit tricky when done dimension
// independant, so we write this function
template <>
-double QuadAccessor<3>::measure () const {
+double TriaObjectAccessor<2, 3>::measure () const {
// the evaluation of the formulae
// is a bit tricky when done dimension
// independant, so we write this function
template <int dim>
-unsigned int QuadAccessor<dim>::number_of_children () const {
+unsigned int TriaObjectAccessor<2, dim>::number_of_children () const {
if (!has_children())
return 1;
else
// explicit instantiations
template class TriaAccessor<deal_II_dimension>;
-template class LineAccessor<deal_II_dimension>;
+template class TriaObjectAccessor<1, deal_II_dimension>;
template class CellAccessor<deal_II_dimension>;
-template class TriaRawIterator<deal_II_dimension,LineAccessor<deal_II_dimension> >;
+template class TriaRawIterator<deal_II_dimension,TriaObjectAccessor<1, deal_II_dimension> >;
template class TriaRawIterator<deal_II_dimension,CellAccessor<deal_II_dimension> >;
-template class TriaIterator<deal_II_dimension,LineAccessor<deal_II_dimension> >;
+template class TriaIterator<deal_II_dimension,TriaObjectAccessor<1, deal_II_dimension> >;
template class TriaIterator<deal_II_dimension,CellAccessor<deal_II_dimension> >;
-template class TriaActiveIterator<deal_II_dimension,LineAccessor<deal_II_dimension> >;
+template class TriaActiveIterator<deal_II_dimension,TriaObjectAccessor<1, deal_II_dimension> >;
template class TriaActiveIterator<deal_II_dimension,CellAccessor<deal_II_dimension> >;
#if deal_II_dimension >= 2
-template class QuadAccessor<deal_II_dimension>;
-template class TriaRawIterator<deal_II_dimension,QuadAccessor<deal_II_dimension> >;
-template class TriaIterator<deal_II_dimension,QuadAccessor<deal_II_dimension> >;
-template class TriaActiveIterator<deal_II_dimension,QuadAccessor<deal_II_dimension> >;
+template class TriaObjectAccessor<2, deal_II_dimension>;
+template class TriaRawIterator<deal_II_dimension,TriaObjectAccessor<2, deal_II_dimension> >;
+template class TriaIterator<deal_II_dimension,TriaObjectAccessor<2, deal_II_dimension> >;
+template class TriaActiveIterator<deal_II_dimension,TriaObjectAccessor<2, deal_II_dimension> >;
#endif
#if deal_II_dimension >= 3
/* ------------------------ MGDoFLineAccessor --------------------------- */
template <int dim, typename BaseClass>
-MGDoFLineAccessor<dim,BaseClass>::MGDoFLineAccessor (Triangulation<dim> *tria,
+MGDoFObjectAccessor<1, dim,BaseClass>::MGDoFObjectAccessor (Triangulation<dim> *tria,
const int level,
const int index,
const AccessorData *local_data) :
MGDoFAccessor<dim> (local_data),
- DoFLineAccessor<dim,BaseClass>(tria,level,index,local_data) {};
+ DoFObjectAccessor<1, dim,BaseClass>(tria,level,index,local_data) {};
template <int dim, typename BaseClass>
-int MGDoFLineAccessor<dim,BaseClass>::mg_dof_index (const unsigned int i) const {
+int MGDoFObjectAccessor<1, dim,BaseClass>::mg_dof_index (const unsigned int i) const {
Assert (dof_handler != 0, ExcInvalidObject());
Assert (mg_dof_handler != 0, ExcInvalidObject());
// make sure a FE has been selected
template <int dim, typename BaseClass>
-void MGDoFLineAccessor<dim,BaseClass>::set_mg_dof_index (const unsigned int i,
+void MGDoFObjectAccessor<1, dim,BaseClass>::set_mg_dof_index (const unsigned int i,
const int index) const {
Assert (dof_handler != 0, ExcInvalidObject());
Assert (mg_dof_handler != 0, ExcInvalidObject());
template <int dim, typename BaseClass>
-int MGDoFLineAccessor<dim,BaseClass>::mg_vertex_dof_index (const unsigned int vertex,
+int MGDoFObjectAccessor<1, dim,BaseClass>::mg_vertex_dof_index (const unsigned int vertex,
const unsigned int i) const {
Assert (dof_handler != 0, ExcInvalidObject());
Assert (mg_dof_handler != 0, ExcInvalidObject());
template <int dim, typename BaseClass>
-void MGDoFLineAccessor<dim,BaseClass>::set_mg_vertex_dof_index (const unsigned int vertex,
+void MGDoFObjectAccessor<1, dim,BaseClass>::set_mg_vertex_dof_index (const unsigned int vertex,
const unsigned int i,
const int index) const {
Assert (dof_handler != 0, ExcInvalidObject());
template <int dim, typename BaseClass>
void
-MGDoFLineAccessor<dim,BaseClass>::get_mg_dof_indices (vector<int> &dof_indices) const {
+MGDoFObjectAccessor<1, dim,BaseClass>::get_mg_dof_indices (vector<int> &dof_indices) const {
Assert (dof_handler != 0, ExcInvalidObject());
Assert (mg_dof_handler != 0, ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, ExcInvalidObject());
template <int dim, typename BaseClass>
-TriaIterator<dim,MGDoFLineAccessor<dim,BaseClass> >
-MGDoFLineAccessor<dim,BaseClass>::child (const unsigned int i) const {
- TriaIterator<dim,MGDoFLineAccessor<dim,BaseClass> > q (tria,
+TriaIterator<dim,MGDoFObjectAccessor<1, dim,BaseClass> >
+MGDoFObjectAccessor<1, dim,BaseClass>::child (const unsigned int i) const {
+ TriaIterator<dim,MGDoFObjectAccessor<1, dim,BaseClass> > q (tria,
present_level+1,
child_index (i),
mg_dof_handler);
template <int dim, typename BaseClass>
void
-MGDoFLineAccessor<dim,BaseClass>::copy_from (const MGDoFLineAccessor<dim,BaseClass> &a) {
- DoFLineAccessor<dim,BaseClass>::copy_from (a);
+MGDoFObjectAccessor<1, dim,BaseClass>::copy_from (const MGDoFObjectAccessor<1, dim,BaseClass> &a)
+{
+ DoFObjectAccessor<1, dim,BaseClass>::copy_from (a);
set_mg_dof_handler (a.mg_dof_handler);
};
/* ------------------------ MGDoFQuadAccessor --------------------------- */
template <int dim, typename BaseClass>
-MGDoFQuadAccessor<dim,BaseClass>::MGDoFQuadAccessor (Triangulation<dim> *tria,
+MGDoFObjectAccessor<2, dim,BaseClass>::MGDoFObjectAccessor (Triangulation<dim> *tria,
const int level,
const int index,
const AccessorData *local_data) :
MGDoFAccessor<dim> (local_data),
- DoFQuadAccessor<dim,BaseClass>(tria,level,index,local_data) {};
+ DoFObjectAccessor<2, dim,BaseClass>(tria,level,index,local_data)
+{};
template <int dim, typename BaseClass>
inline
-int MGDoFQuadAccessor<dim,BaseClass>::mg_dof_index (const unsigned int i) const {
+int MGDoFObjectAccessor<2, dim,BaseClass>::mg_dof_index (const unsigned int i) const {
Assert (dof_handler != 0, ExcInvalidObject());
Assert (mg_dof_handler != 0, ExcInvalidObject());
// make sure a FE has been selected
template <int dim, typename BaseClass>
-void MGDoFQuadAccessor<dim,BaseClass>::set_mg_dof_index (const unsigned int i,
+void MGDoFObjectAccessor<2, dim,BaseClass>::set_mg_dof_index (const unsigned int i,
const int index) const {
Assert (dof_handler != 0, ExcInvalidObject());
Assert (mg_dof_handler != 0, ExcInvalidObject());
template <int dim, typename BaseClass>
inline
-int MGDoFQuadAccessor<dim,BaseClass>::mg_vertex_dof_index (const unsigned int vertex,
+int MGDoFObjectAccessor<2, dim,BaseClass>::mg_vertex_dof_index (const unsigned int vertex,
const unsigned int i) const {
Assert (dof_handler != 0, ExcInvalidObject());
Assert (mg_dof_handler != 0, ExcInvalidObject());
template <int dim, typename BaseClass>
-void MGDoFQuadAccessor<dim,BaseClass>::set_mg_vertex_dof_index (const unsigned int vertex,
+void MGDoFObjectAccessor<2, dim,BaseClass>::set_mg_vertex_dof_index (const unsigned int vertex,
const unsigned int i,
const int index) const {
Assert (dof_handler != 0, ExcInvalidObject());
template <int dim, typename BaseClass>
void
-MGDoFQuadAccessor<dim,BaseClass>::get_mg_dof_indices (vector<int> &dof_indices) const {
+MGDoFObjectAccessor<2, dim,BaseClass>::get_mg_dof_indices (vector<int> &dof_indices) const {
Assert (dof_handler != 0, ExcInvalidObject());
Assert (mg_dof_handler != 0, ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, ExcInvalidObject());
template <int dim, typename BaseClass>
-TriaIterator<dim,MGDoFLineAccessor<dim,LineAccessor<dim> > >
-MGDoFQuadAccessor<dim,BaseClass>::line (const unsigned int i) const {
+TriaIterator<dim,MGDoFObjectAccessor<1, dim,TriaObjectAccessor<1, dim> > >
+MGDoFObjectAccessor<2, dim,BaseClass>::line (const unsigned int i) const {
Assert (i<4, ExcIndexRange (i, 0, 4));
- return TriaIterator<dim,MGDoFLineAccessor<dim,LineAccessor<dim> > >
+ return TriaIterator<dim,MGDoFObjectAccessor<1, dim,TriaObjectAccessor<1, dim> > >
(
tria,
present_level,
template <int dim, typename BaseClass>
-TriaIterator<dim,MGDoFQuadAccessor<dim,BaseClass> >
-MGDoFQuadAccessor<dim,BaseClass>::child (const unsigned int i) const {
- TriaIterator<dim,MGDoFQuadAccessor<dim,BaseClass> > q (tria,
+TriaIterator<dim,MGDoFObjectAccessor<2, dim,BaseClass> >
+MGDoFObjectAccessor<2, dim,BaseClass>::child (const unsigned int i) const {
+ TriaIterator<dim,MGDoFObjectAccessor<2, dim,BaseClass> > q (tria,
present_level+1,
child_index (i),
mg_dof_handler);
template <int dim, typename BaseClass>
void
-MGDoFQuadAccessor<dim,BaseClass>::copy_from (const MGDoFQuadAccessor<dim,BaseClass> &a) {
- DoFQuadAccessor<dim,BaseClass>::copy_from (a);
+MGDoFObjectAccessor<2, dim,BaseClass>::copy_from (const MGDoFObjectAccessor<2, dim,BaseClass> &a) {
+ DoFObjectAccessor<2, dim,BaseClass>::copy_from (a);
set_mg_dof_handler (a.mg_dof_handler);
};
template <int dim, typename BaseClass>
-TriaIterator<dim,MGDoFLineAccessor<dim,LineAccessor<dim> > >
+TriaIterator<dim,MGDoFObjectAccessor<1, dim,TriaObjectAccessor<1, dim> > >
MGDoFHexAccessor<dim,BaseClass>::line (const unsigned int i) const {
Assert (i<12, ExcIndexRange (i, 0, 12));
- return TriaIterator<dim,MGDoFLineAccessor<dim,LineAccessor<dim> > >
+ return TriaIterator<dim,MGDoFObjectAccessor<1, dim,TriaObjectAccessor<1, dim> > >
(
tria,
present_level,
template <int dim, typename BaseClass>
-TriaIterator<dim,MGDoFQuadAccessor<dim,QuadAccessor<dim> > >
+TriaIterator<dim,MGDoFObjectAccessor<2, dim,TriaObjectAccessor<2, dim> > >
MGDoFHexAccessor<dim,BaseClass>::quad (const unsigned int i) const {
Assert (i<12, ExcIndexRange (i, 0, 6));
- return TriaIterator<dim,MGDoFQuadAccessor<dim,QuadAccessor<dim> > >
+ return TriaIterator<dim,MGDoFObjectAccessor<2, dim,TriaObjectAccessor<2, dim> > >
(
tria,
present_level,
// explicit instantiations
#if deal_II_dimension == 1
-template class MGDoFLineAccessor<1,CellAccessor<1> >;
+template class MGDoFObjectAccessor<1, 1,CellAccessor<1> >;
template class MGDoFCellAccessor<1>;
template class TriaRawIterator<1,MGDoFCellAccessor<1> >;
#endif
#if deal_II_dimension == 2
-template class MGDoFLineAccessor<2,LineAccessor<2> >;
-template class MGDoFQuadAccessor<2,QuadAccessor<2> >;
-template class MGDoFQuadAccessor<2,CellAccessor<2> >;
+template class MGDoFObjectAccessor<1, 2,TriaObjectAccessor<1, 2> >;
+template class MGDoFObjectAccessor<2, 2,TriaObjectAccessor<2, 2> >;
+template class MGDoFObjectAccessor<2, 2,CellAccessor<2> >;
template class MGDoFCellAccessor<2>;
-template class TriaRawIterator<2,MGDoFLineAccessor<2,LineAccessor<2> > >;
+template class TriaRawIterator<2,MGDoFObjectAccessor<1, 2,TriaObjectAccessor<1, 2> > >;
template class TriaRawIterator<2,MGDoFCellAccessor<2> >;
-template class TriaIterator<2,MGDoFLineAccessor<2,LineAccessor<2> > >;
+template class TriaIterator<2,MGDoFObjectAccessor<1, 2,TriaObjectAccessor<1, 2> > >;
template class TriaIterator<2,MGDoFCellAccessor<2> >;
-template class TriaActiveIterator<2,MGDoFLineAccessor<2,LineAccessor<2> > >;
+template class TriaActiveIterator<2,MGDoFObjectAccessor<1, 2,TriaObjectAccessor<1, 2> > >;
template class TriaActiveIterator<2,MGDoFCellAccessor<2> >;
#endif
#if deal_II_dimension == 3
-template class MGDoFLineAccessor<3,LineAccessor<3> >;
-template class MGDoFQuadAccessor<3,QuadAccessor<3> >;
+template class MGDoFObjectAccessor<1, 3,TriaObjectAccessor<1, 3> >;
+template class MGDoFObjectAccessor<2, 3,TriaObjectAccessor<2, 3> >;
template class MGDoFHexAccessor<3,HexAccessor<3> >;
template class MGDoFHexAccessor<3,CellAccessor<3> >;
template class MGDoFCellAccessor<3>;
-template class TriaRawIterator<3,MGDoFLineAccessor<3,LineAccessor<3> > >;
-template class TriaRawIterator<3,MGDoFQuadAccessor<3,QuadAccessor<3> > >;
+template class TriaRawIterator<3,MGDoFObjectAccessor<1, 3,TriaObjectAccessor<1, 3> > >;
+template class TriaRawIterator<3,MGDoFObjectAccessor<2, 3,TriaObjectAccessor<2, 3> > >;
template class TriaRawIterator<3,MGDoFHexAccessor<3,HexAccessor<3> > >;
template class TriaRawIterator<3,MGDoFCellAccessor<3> >;
-template class TriaIterator<3,MGDoFLineAccessor<3,LineAccessor<3> > >;
-template class TriaIterator<3,MGDoFQuadAccessor<3,QuadAccessor<3> > >;
+template class TriaIterator<3,MGDoFObjectAccessor<1, 3,TriaObjectAccessor<1, 3> > >;
+template class TriaIterator<3,MGDoFObjectAccessor<2, 3,TriaObjectAccessor<2, 3> > >;
template class TriaIterator<3,MGDoFCellAccessor<3> >;
-template class TriaActiveIterator<3,MGDoFLineAccessor<3,LineAccessor<3> > >;
-template class TriaActiveIterator<3,MGDoFQuadAccessor<3,QuadAccessor<3> > >;
+template class TriaActiveIterator<3,MGDoFObjectAccessor<1, 3,TriaObjectAccessor<1, 3> > >;
+template class TriaActiveIterator<3,MGDoFObjectAccessor<2, 3,TriaObjectAccessor<2, 3> > >;
template class TriaActiveIterator<3,MGDoFCellAccessor<3> >;
#endif
--- /dev/null
+# $Id$
+# Common Makefile for all test directories
+
+all:
+ cd base ; make
+ cd lac ; make
+ cd deal.II ; make
--- /dev/null
+DEAL.II TESTSUITE README
+========================
+
+Subdirectories in this tree contain test programs for various features
+of base lac and deal.II libraries.
+
+All features of deal that should be available in future releases
+should be tested here.
+
+Run make in this directory to do all tests. This is required before
+any commit to the CVS repository.
+
+How to interpret the output?
+----------------------------
+
+Apart from several messages containing compiling and linking
+information, the output of make will contain lines like
+
+=====Running======== heavy.testcase
+=====OK=============
+
+If the second line is replaced by some diff-output, please check for
+consistency. A check-in of the modified results should be considered
+carefully.
############################################################
%.output:%.testcase
- $<
+ @echo =====Running======= $<
+ @$<
@perl -pi.bak -e 's/JobId.*//;s/value.*//;' $@
@rm $@.bak
%.check:%.output
- @-diff $< $(patsubst %.output,%.checked, $<)
+ @-diff $< $(patsubst %.output,%.checked, $<) && echo '=====OK============'
############################################################
# Cleanup targets
############################################################
template <int dim>
class Ball :
- public StraightBoundary<dim> {
+ public StraightBoundary<dim>
+{
public:
virtual Point<dim>
get_new_point_on_line (const typename Triangulation<dim>::line_iterator &line) const {
template <int dim>
class CurvedLine :
- public StraightBoundary<dim> {
+ public StraightBoundary<dim>
+{
public:
virtual Point<dim>
get_new_point_on_line (const typename Triangulation<dim>::line_iterator &line) const;
template <int dim>
-void test (const int test_case) {
+void test (const int test_case)
+{
cout << "Running testcase " << test_case
<< " in " << dim << " dimensions." << endl;
Triangulation<dim> tria;
tria.execute_coarsening_and_refinement();
};
- tria.set_boundary (0);
+ tria.set_boundary (1);
break;
}
};
#include <grid/tria.h>
#include <grid/tria_iterator.h>
#include <grid/mg_dof.h>
+#include <grid/dof_constraints.h>
#include <grid/dof_accessor.h>
#include <grid/mg_dof_accessor.h>
#include <grid/grid_generator.h>
case 4: fe = &fe4; deallog.push("Q4"); break;
}
- for (unsigned int step=0;step < 5; ++step)
+ for (unsigned int step=0;step < 4; ++step)
{
tr.refine_global(1);
dof.distribute_dofs(*fe);
+ ConstraintMatrix hanging_nodes;
+ dof.make_hanging_node_constraints(hanging_nodes);
+ hanging_nodes.close();
+
const unsigned int size = dof.n_dofs();
deallog << "DoFs " << size << endl;
deallog << "Levels: " << tr.n_levels() << endl;
transfer.build_matrices(mgdof);
- MG<2> multigrid(mgdof, mgA, transfer);
+ MG<2> multigrid(mgdof, hanging_nodes, mgA, transfer);
PreconditionMG<MG<2>, Vector<double> >
mgprecondition(multigrid, smoother, smoother, coarse);
--- /dev/null
+// $Id$
+/* (c) Guido Kanschat, 1999 */
+
+// deal_II_libraries.g=-ldeal_II_2d.g
+// deal_II_libraries=-ldeal_II_2d
+
+#include <base/function.h>
+#include <base/quadrature_lib.h>
+#include <lac/vector.h>
+#include <lac/sparsematrix.h>
+#include <lac/solver_cg.h>
+#include <lac/solver_richardson.h>
+#include <lac/vector_memory.h>
+#include <lac/precondition.h>
+#include <grid/tria.h>
+#include <grid/tria_iterator.h>
+#include <grid/mg_dof.h>
+#include <grid/dof_constraints.h>
+#include <grid/dof_accessor.h>
+#include <grid/mg_dof_accessor.h>
+#include <grid/grid_generator.h>
+#include <basic/data_io.h>
+#include <fe/fe_lib.lagrange.h>
+#include <fe/fe_values.h>
+#include <numerics/multigrid.h>
+#include <numerics/mg_smoother.h>
+MGSmoother* smoother_object;
+#include <numerics/multigrid.templates.h>
+
+#include <fstream>
+
+// Does anybody know why cmath does not do this?
+
+#ifndef M_PI_2
+#define M_PI_2 1.57079632679489661923
+#endif
+
+
+
+int step_counter = 0;
+
+#include "helmholtz.h"
+
+template<int dim>
+class RHSFunction
+ :
+ public Function<dim>
+{
+ public:
+ virtual double operator() (const Point<dim>&) const;
+// virtual Tensor<1,dim> gradient (const Point<dim> &p) const;
+};
+
+extern void write_gnuplot (const MGDoFHandler<2>& dofs, const Vector<double>& v, unsigned int level,
+ ostream &out);
+
+main()
+{
+ Helmholtz equation;
+ RHSFunction<2> rhs;
+ QGauss5<2> quadrature;
+
+ FEQ1<2> fe1;
+ FEQ2<2> fe2;
+ FEQ3<2> fe3;
+ FEQ4<2> fe4;
+ for (unsigned int degree=1;degree<=1;degree++)
+ {
+ Triangulation<2> tr;
+ MGDoFHandler<2> mgdof(&tr);
+ DoFHandler<2>& dof(mgdof);
+
+ GridGenerator::hyper_cube(tr,-M_PI_2,M_PI_2);
+
+ FiniteElement<2>* fe;
+ switch(degree)
+ {
+ case 1: fe = &fe1; deallog.push("Q1"); break;
+ case 2: fe = &fe2; deallog.push("Q2"); break;
+ case 3: fe = &fe3; deallog.push("Q3"); break;
+ case 4: fe = &fe4; deallog.push("Q4"); break;
+ }
+
+ tr.refine_global(1);
+ Triangulation<2>::active_cell_iterator cell = tr.begin_active();
+ cell->set_refine_flag();
+ tr.execute_coarsening_and_refinement();
+
+ tr.refine_global(2);
+ dof.distribute_dofs(*fe);
+ const unsigned int size = dof.n_dofs();
+ deallog << "DoFs " << size << endl;
+ deallog << "Levels: " << tr.n_levels() << endl;
+ for (unsigned int step=1;step < 5; ++step)
+ {
+ deallog << "smoothing-steps" << step << endl;
+ SparseMatrixStruct structure(size, dof.max_couplings_between_dofs());
+ dof.make_sparsity_pattern(structure);
+
+ ConstraintMatrix hanging_nodes;
+ dof.make_hanging_node_constraints(hanging_nodes);
+ hanging_nodes.close();
+ hanging_nodes.condense(structure);
+
+ structure.compress();
+
+ SparseMatrix<double> A(structure);
+ Vector<double> f(size);
+
+ equation.build_all(A,f,dof, quadrature, rhs);
+
+ hanging_nodes.condense(A);
+ hanging_nodes.condense(f);
+
+ Vector<double> u;
+ u.reinit(f);
+ PrimitiveVectorMemory<Vector<double> > mem;
+ SolverControl control(20, 1.e-12, true);
+ SolverRichardson<SparseMatrix<double>, Vector<double> >solver(control, mem);
+
+ vector<SparseMatrixStruct> mgstruct(tr.n_levels());
+ MGMatrix<SparseMatrix<double> > mgA(0,tr.n_levels()-1);
+ for (unsigned int i=0;i<tr.n_levels();++i)
+ {
+ mgstruct[i].reinit(mgdof.n_dofs(i), mgdof.n_dofs(i),
+ mgdof.max_couplings_between_dofs());
+ mgdof.make_sparsity_pattern(i, mgstruct[i]);
+ mgstruct[i].compress();
+
+ mgA[i].reinit(mgstruct[i]);
+ }
+ equation.build_mgmatrix(mgA, mgdof, quadrature);
+
+ SolverControl cgcontrol(20,0., false, false);
+ PrimitiveVectorMemory<Vector<double> > cgmem;
+ SolverCG<SparseMatrix<double>, Vector<double> > cgsolver(cgcontrol, cgmem);
+ PreconditionIdentity<Vector<double> > cgprec;
+ MGCoarseGridLACIteration<SolverCG<SparseMatrix<double>, Vector<double> >,
+ SparseMatrix<double>, PreconditionIdentity<Vector<double> > >
+ coarse(cgsolver, mgA[tr.n_levels()-2], cgprec);
+
+ MGSmootherRelaxation<double>
+ smoother(mgdof, mgA, &SparseMatrix<double>::template precondition_SSOR<double>,
+ step, 1.);
+ smoother_object = &smoother;
+
+ MGTransferPrebuilt transfer;
+ transfer.build_matrices(mgdof);
+
+
+ MG<2> multigrid(mgdof, hanging_nodes, mgA, transfer, tr.n_levels()-2);
+ PreconditionMG<MG<2>, Vector<double> >
+ mgprecondition(multigrid, smoother, smoother, coarse);
+
+ u = 0.;
+
+ solver.solve(A, u, f, mgprecondition);
+ hanging_nodes.distribute(u);
+ }
+ deallog.pop();
+ }
+}
+
+template<int dim>
+double
+RHSFunction<dim>::operator() (const Point<dim>&p) const
+{
+// return 1.;
+
+ return p(0)*p(0)+p(1)*p(1);
+
+ return (2.1)*(sin(p(0))* sin(p(1)));
+}
+
+
+void write_gnuplot (const MGDoFHandler<2>& dofs, const Vector<double>& v, unsigned int level,
+ ostream &out)
+{
+ MGDoFHandler<2>::cell_iterator cell;
+ MGDoFHandler<2>::cell_iterator endc = dofs.end(level);
+
+ Vector<double> values(dofs.get_fe().total_dofs);
+
+ unsigned int cell_index=0;
+ for (cell=dofs.begin(level); cell!=endc; ++cell, ++cell_index)
+ {
+ cell->get_mg_dof_values(v, values);
+
+ out << cell->vertex(0) << " " << values(0) << endl;
+ out << cell->vertex(1) << " " << values(1) << endl;
+ out << endl;
+ out << cell->vertex(3) << " " << values(3) << endl;
+ out << cell->vertex(2) << " " << values(2) << endl;
+ out << endl;
+ out << endl;
+ }
+ out << endl;
+}
############################################################
%.output:%.testcase
- $<
+ @echo =====Running======= $<
+ @$<
@perl -pi.bak -e 's/JobId.*//;s/value.*//;' $@
@rm $@.bak
%.check:%.output
- @-diff $< $(patsubst %.output,%.checked, $<)
+ @-diff $< $(patsubst %.output,%.checked, $<) && echo '=====OK============'
############################################################
# Cleanup targets
############################################################