From 7eda52ffb1426c2268aa0f9fbc95c2afe7d8e9d0 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 27 Apr 2006 05:01:34 +0000 Subject: [PATCH] Split off a few functions that will have to be implemented differently for hp and non-hp git-svn-id: https://svn.dealii.org/trunk@12919 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/dofs/dof_accessor.h | 194 +--- .../include/dofs/dof_accessor.templates.h | 951 +++++++----------- deal.II/deal.II/include/dofs/hp_dof_handler.h | 5 + deal.II/deal.II/source/dofs/dof_accessor.cc | 328 ++++-- 4 files changed, 689 insertions(+), 789 deletions(-) diff --git a/deal.II/deal.II/include/dofs/dof_accessor.h b/deal.II/deal.II/include/dofs/dof_accessor.h index 63761b4c65..80f0967a7c 100644 --- a/deal.II/deal.II/include/dofs/dof_accessor.h +++ b/deal.II/deal.II/include/dofs/dof_accessor.h @@ -417,35 +417,6 @@ class DoFObjectAccessor : public DoFAccessor, void set_dof_values (const Vector &local_values, OutputVector &values) const; - - /** - * Return the finite element that - * is used on the cell pointed to - * by this iterator. For non-hp - * DoF handlers, this is of - * course always the same - * element, independent of the - * cell we are presently on, but - * for hp DoF handlers, this may - * change from cell to cell. - */ - const FiniteElement & - get_fe () const; - - /** - * Returns the index inside the - * hp::FECollection of the FiniteElement - * used for this cell. - */ - unsigned int active_fe_index () const; - - /** - * Sets the index of the FiniteElement used for - * this cell. - */ - void set_active_fe_index (const unsigned int i); - - /** * Pointer to the ith line * bounding this Object. @@ -718,34 +689,6 @@ class DoFObjectAccessor<1, DH> : void set_dof_values (const Vector &local_values, OutputVector &values) const; - - /** - * Return the finite element that - * is used on the cell pointed to - * by this iterator. For non-hp - * DoF handlers, this is of - * course always the same - * element, independent of the - * cell we are presently on, but - * for hp DoF handlers, this may - * change from cell to cell. - */ - const FiniteElement & - get_fe () const; - - /** - * Returns the index inside the - * hp::FECollection of the FiniteElement - * used for this cell. - */ - unsigned int active_fe_index () const; - - /** - * Sets the index of the FiniteElement used for - * this cell. - */ - void set_active_fe_index (const unsigned int i); - /** * Return the @p ith child as a DoF line * iterator. This function is needed since @@ -949,34 +892,6 @@ class DoFObjectAccessor<2, DH> : void set_dof_values (const Vector &local_values, OutputVector &values) const; - - /** - * Return the finite element that - * is used on the cell pointed to - * by this iterator. For non-hp - * DoF handlers, this is of - * course always the same - * element, independent of the - * cell we are presently on, but - * for hp DoF handlers, this may - * change from cell to cell. - */ - const FiniteElement & - get_fe () const; - - /** - * Returns the index inside the - * hp::FECollection of the FiniteElement - * used for this cell. - */ - unsigned int active_fe_index () const; - - /** - * Sets the index of the FiniteElement used for - * this cell. - */ - void set_active_fe_index (const unsigned int i); - /** * Return a pointer to the @p ith line * bounding this @p Quad. @@ -1188,34 +1103,6 @@ class DoFObjectAccessor<3, DH> : void set_dof_values (const Vector &local_values, OutputVector &values) const; - - /** - * Return the finite element that - * is used on the cell pointed to - * by this iterator. For non-hp - * DoF handlers, this is of - * course always the same - * element, independent of the - * cell we are presently on, but - * for hp DoF handlers, this may - * change from cell to cell. - */ - const FiniteElement & - get_fe () const; - - /** - * Returns the index inside the - * hp::FECollection of the FiniteElement - * used for this cell. - */ - unsigned int active_fe_index () const; - - /** - * Sets the index of the FiniteElement used for - * this cell. - */ - void set_active_fe_index (const unsigned int i); - /** * Return a pointer to the @p ith line * bounding this @p Hex. @@ -1566,6 +1453,33 @@ class DoFCellAccessor : public DoFObjectAccessor */ void get_dof_indices (std::vector &dof_indices) const; + /** + * Return the finite element that + * is used on the cell pointed to + * by this iterator. For non-hp + * DoF handlers, this is of + * course always the same + * element, independent of the + * cell we are presently on, but + * for hp DoF handlers, this may + * change from cell to cell. + */ + const FiniteElement & + get_fe () const; + + /** + * Returns the index inside the + * hp::FECollection of the FiniteElement + * used for this cell. + */ + unsigned int active_fe_index () const; + + /** + * Sets the index of the FiniteElement used for + * this cell. + */ + void set_active_fe_index (const unsigned int i); + /** * Distribute a local (cell * based) vector to a global one @@ -1633,25 +1547,6 @@ template <> TriaIterator<3, DoFObjectAccessor<2,DoFHandler<3> > > DoFCellAccessor >::face (const unsigned int i) const; -template <> -const FiniteElement<1> & -DoFObjectAccessor<1,hp::DoFHandler<1> >::get_fe () const; -template <> -const FiniteElement<2> & -DoFObjectAccessor<1,hp::DoFHandler<2> >::get_fe () const; -template <> -const FiniteElement<3> & -DoFObjectAccessor<1,hp::DoFHandler<3> >::get_fe () const; -template <> -const FiniteElement<2> & -DoFObjectAccessor<2,hp::DoFHandler<2> >::get_fe () const; -template <> -const FiniteElement<3> & -DoFObjectAccessor<2,hp::DoFHandler<3> >::get_fe () const; -template <> -const FiniteElement<3> & -DoFObjectAccessor<3,hp::DoFHandler<3> >::get_fe () const; - template <> void DoFObjectAccessor<1,hp::DoFHandler<1> >::set_dof_index (const unsigned int, const unsigned int) const; @@ -1673,43 +1568,34 @@ void DoFObjectAccessor<3,hp::DoFHandler<3> >::set_dof_index (const unsigned int, template <> -unsigned int -DoFObjectAccessor<1,hp::DoFHandler<1> >::active_fe_index () const; +const FiniteElement<1> & +DoFCellAccessor >::get_fe () const; template <> -unsigned int -DoFObjectAccessor<1,hp::DoFHandler<2> >::active_fe_index () const; +const FiniteElement<2> & +DoFCellAccessor >::get_fe () const; template <> -unsigned int -DoFObjectAccessor<1,hp::DoFHandler<3> >::active_fe_index () const; +const FiniteElement<3> & +DoFCellAccessor >::get_fe () const; + template <> unsigned int -DoFObjectAccessor<2,hp::DoFHandler<2> >::active_fe_index () const; +DoFCellAccessor >::active_fe_index () const; template <> unsigned int -DoFObjectAccessor<2,hp::DoFHandler<3> >::active_fe_index () const; +DoFCellAccessor >::active_fe_index () const; template <> unsigned int -DoFObjectAccessor<3,hp::DoFHandler<3> >::active_fe_index () const; +DoFCellAccessor >::active_fe_index () const; template <> void -DoFObjectAccessor<1,hp::DoFHandler<1> >::set_active_fe_index (const unsigned int i); -template <> -void -DoFObjectAccessor<1,hp::DoFHandler<2> >::set_active_fe_index (const unsigned int i); +DoFCellAccessor >::set_active_fe_index (const unsigned int i); template <> void -DoFObjectAccessor<1,hp::DoFHandler<3> >::set_active_fe_index (const unsigned int i); +DoFCellAccessor >::set_active_fe_index (const unsigned int i); template <> void -DoFObjectAccessor<2,hp::DoFHandler<2> >::set_active_fe_index (const unsigned int i); -template <> -void -DoFObjectAccessor<2,hp::DoFHandler<3> >::set_active_fe_index (const unsigned int i); -template <> -void -DoFObjectAccessor<3,hp::DoFHandler<3> >::set_active_fe_index (const unsigned int i); - +DoFCellAccessor >::set_active_fe_index (const unsigned int i); template <> void diff --git a/deal.II/deal.II/include/dofs/dof_accessor.templates.h b/deal.II/deal.II/include/dofs/dof_accessor.templates.h index ec2209b1de..9552b1007d 100644 --- a/deal.II/deal.II/include/dofs/dof_accessor.templates.h +++ b/deal.II/deal.II/include/dofs/dof_accessor.templates.h @@ -150,37 +150,6 @@ DoFObjectAccessor<1,DH>::child (const unsigned int i) const -template -inline -const FiniteElement & -DoFObjectAccessor<1,DH>::get_fe () const -{ - return *this->dof_handler->selected_fe; -} - - - -template -inline -unsigned int -DoFObjectAccessor<1,DH>::active_fe_index () const -{ - return 0; -} - - - -template -inline -void -DoFObjectAccessor<1,DH>::set_active_fe_index (const unsigned int i) -{ - typedef DoFAccessor BaseClass; - Assert (i == 0, typename BaseClass::ExcInvalidObject()); -} - - - template inline void @@ -273,37 +242,6 @@ DoFObjectAccessor<2,DH>::child (const unsigned int i) const -template -inline -const FiniteElement & -DoFObjectAccessor<2,DH>::get_fe () const -{ - return *this->dof_handler->selected_fe; -} - - - -template -inline -unsigned int -DoFObjectAccessor<2,DH>::active_fe_index () const -{ - return 0; -} - - - -template -inline -void -DoFObjectAccessor<2,DH>::set_active_fe_index (const unsigned int i) -{ - typedef DoFAccessor BaseClass; - Assert (i == 0, typename BaseClass::ExcInvalidObject()); -} - - - template inline void @@ -407,37 +345,6 @@ DoFObjectAccessor<3,DH>::child (const unsigned int i) const } -template -inline -const FiniteElement & -DoFObjectAccessor<3,DH>::get_fe () const -{ - return *this->dof_handler->selected_fe; -} - - - -template -inline -unsigned int -DoFObjectAccessor<3,DH>::active_fe_index () const -{ - return 0; -} - - - -template -inline -void -DoFObjectAccessor<3,DH>::set_active_fe_index (const unsigned int i) -{ - typedef DoFAccessor BaseClass; - Assert (i == 0, typename BaseClass::ExcInvalidObject()); -} - - - template void DoFObjectAccessor<3,DH>::copy_from (const DoFObjectAccessor<3,DH> &a) { @@ -483,12 +390,12 @@ DoFObjectAccessor<1,DoFHandler<1> >::dof_index (const unsigned int i) const Assert (this->dof_handler != 0, DoFAccessor >::ExcInvalidObject()); // make sure a FE has been selected // and enough room was reserved - Assert (&this->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); - Assert (iget_fe().dofs_per_line, - ExcIndexRange (i, 0, this->get_fe().dofs_per_line)); + Assert (&this->dof_handler->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); + Assert (idof_handler->get_fe().dofs_per_line, + ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_line)); return this->dof_handler->levels[this->present_level] - ->line_dofs[this->present_index*this->get_fe().dofs_per_line+i]; + ->line_dofs[this->present_index*this->dof_handler->get_fe().dofs_per_line+i]; } @@ -503,13 +410,13 @@ DoFObjectAccessor<1,DoFHandler<1> >::vertex_dof_index (const unsigned int vertex ExcMessage ("DoFHandler not initialized")); Assert (this->dof_handler != 0, DoFAccessor >::ExcInvalidObject()); - Assert (&this->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); + Assert (&this->dof_handler->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); Assert (vertex<2, ExcIndexRange (i,0,2)); - Assert (iget_fe().dofs_per_vertex, - ExcIndexRange (i, 0, this->get_fe().dofs_per_vertex)); + Assert (idof_handler->get_fe().dofs_per_vertex, + ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_vertex)); const unsigned int dof_number = (this->vertex_index(vertex) * - this->get_fe().dofs_per_vertex + + this->dof_handler->get_fe().dofs_per_vertex + i); return this->dof_handler->vertex_dofs[dof_number]; } @@ -525,9 +432,9 @@ DoFObjectAccessor<1,DoFHandler<1> >::get_dof_indices (std::vector ExcMessage ("DoFHandler not initialized")); Assert (this->dof_handler != 0, DoFAccessor >::ExcInvalidObject()); - Assert (&this->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); - Assert (dof_indices.size() == (2*this->get_fe().dofs_per_vertex + - this->get_fe().dofs_per_line), + Assert (&this->dof_handler->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); + Assert (dof_indices.size() == (2*this->dof_handler->get_fe().dofs_per_vertex + + this->dof_handler->get_fe().dofs_per_line), DoFAccessor >::ExcVectorDoesNotMatch()); // this function really only makes @@ -539,12 +446,12 @@ DoFObjectAccessor<1,DoFHandler<1> >::get_dof_indices (std::vector // not allocated for this // non-active thing Assert (!this->has_children() || - (this->get_fe().dofs_per_cell == - 2*this->get_fe().dofs_per_vertex), + (this->dof_handler->get_fe().dofs_per_cell == + 2*this->dof_handler->get_fe().dofs_per_vertex), DoFAccessor >::ExcNotActive()); - const unsigned int dofs_per_vertex = this->get_fe().dofs_per_vertex, - dofs_per_line = this->get_fe().dofs_per_line; + const unsigned int dofs_per_vertex = this->dof_handler->get_fe().dofs_per_vertex, + dofs_per_line = this->dof_handler->get_fe().dofs_per_line; std::vector::iterator next = dof_indices.begin(); for (unsigned int vertex=0; vertex<2; ++vertex) for (unsigned int d=0; d >::dof_index (const unsigned int i) const Assert (this->dof_handler != 0, DoFAccessor >::ExcInvalidObject()); // make sure a FE has been selected // and enough room was reserved - Assert (&this->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); - Assert (iget_fe().dofs_per_line, - ExcIndexRange (i, 0, this->get_fe().dofs_per_line)); + Assert (&this->dof_handler->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); + Assert (idof_handler->get_fe().dofs_per_line, + ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_line)); return this->dof_handler->levels[this->present_level] - ->line_dofs[this->present_index*this->get_fe().dofs_per_line+i]; + ->line_dofs[this->present_index*this->dof_handler->get_fe().dofs_per_line+i]; } @@ -586,13 +493,13 @@ DoFObjectAccessor<1,DoFHandler<2> >::vertex_dof_index (const unsigned int vertex ExcMessage ("DoFHandler not initialized")); Assert (this->dof_handler != 0, DoFAccessor >::ExcInvalidObject()); - Assert (&this->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); + Assert (&this->dof_handler->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); Assert (vertex<2, ExcIndexRange (i,0,2)); - Assert (iget_fe().dofs_per_vertex, - ExcIndexRange (i, 0, this->get_fe().dofs_per_vertex)); + Assert (idof_handler->get_fe().dofs_per_vertex, + ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_vertex)); const unsigned int dof_number = (this->vertex_index(vertex) * - this->get_fe().dofs_per_vertex + + this->dof_handler->get_fe().dofs_per_vertex + i); return this->dof_handler->vertex_dofs[dof_number]; } @@ -608,9 +515,9 @@ DoFObjectAccessor<1,DoFHandler<2> >::get_dof_indices (std::vector ExcMessage ("DoFHandler not initialized")); Assert (this->dof_handler != 0, DoFAccessor >::ExcInvalidObject()); - Assert (&this->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); - Assert (dof_indices.size() == (2*this->get_fe().dofs_per_vertex + - this->get_fe().dofs_per_line), + Assert (&this->dof_handler->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); + Assert (dof_indices.size() == (2*this->dof_handler->get_fe().dofs_per_vertex + + this->dof_handler->get_fe().dofs_per_line), DoFAccessor >::ExcVectorDoesNotMatch()); // this function really only makes @@ -622,12 +529,12 @@ DoFObjectAccessor<1,DoFHandler<2> >::get_dof_indices (std::vector // not allocated for this // non-active thing Assert (!this->has_children() || - (this->get_fe().dofs_per_cell == - 2*this->get_fe().dofs_per_vertex), + (this->dof_handler->get_fe().dofs_per_cell == + 2*this->dof_handler->get_fe().dofs_per_vertex), DoFAccessor >::ExcNotActive()); - const unsigned int dofs_per_vertex = this->get_fe().dofs_per_vertex, - dofs_per_line = this->get_fe().dofs_per_line; + const unsigned int dofs_per_vertex = this->dof_handler->get_fe().dofs_per_vertex, + dofs_per_line = this->dof_handler->get_fe().dofs_per_line; std::vector::iterator next = dof_indices.begin(); for (unsigned int vertex=0; vertex<2; ++vertex) for (unsigned int d=0; d >::dof_index (const unsigned int i) const Assert (this->dof_handler != 0, DoFAccessor >::ExcInvalidObject()); // make sure a FE has been selected // and enough room was reserved - Assert (&this->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); - Assert (iget_fe().dofs_per_line, - ExcIndexRange (i, 0, this->get_fe().dofs_per_line)); + Assert (&this->dof_handler->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); + Assert (idof_handler->get_fe().dofs_per_line, + ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_line)); return this->dof_handler->levels[this->present_level] - ->line_dofs[this->present_index*this->get_fe().dofs_per_line+i]; + ->line_dofs[this->present_index*this->dof_handler->get_fe().dofs_per_line+i]; } @@ -669,13 +576,13 @@ DoFObjectAccessor<1,DoFHandler<3> >::vertex_dof_index (const unsigned int vertex ExcMessage ("DoFHandler not initialized")); Assert (this->dof_handler != 0, DoFAccessor >::ExcInvalidObject()); - Assert (&this->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); + Assert (&this->dof_handler->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); Assert (vertex<2, ExcIndexRange (i,0,2)); - Assert (iget_fe().dofs_per_vertex, - ExcIndexRange (i, 0, this->get_fe().dofs_per_vertex)); + Assert (idof_handler->get_fe().dofs_per_vertex, + ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_vertex)); const unsigned int dof_number = (this->vertex_index(vertex) * - this->get_fe().dofs_per_vertex + + this->dof_handler->get_fe().dofs_per_vertex + i); return this->dof_handler->vertex_dofs[dof_number]; } @@ -691,9 +598,9 @@ DoFObjectAccessor<1,DoFHandler<3> >::get_dof_indices (std::vector ExcMessage ("DoFHandler not initialized")); Assert (this->dof_handler != 0, DoFAccessor >::ExcInvalidObject()); - Assert (&this->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); - Assert (dof_indices.size() == (2*this->get_fe().dofs_per_vertex + - this->get_fe().dofs_per_line), + Assert (&this->dof_handler->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); + Assert (dof_indices.size() == (2*this->dof_handler->get_fe().dofs_per_vertex + + this->dof_handler->get_fe().dofs_per_line), DoFAccessor >::ExcVectorDoesNotMatch()); // this function really only makes @@ -705,12 +612,12 @@ DoFObjectAccessor<1,DoFHandler<3> >::get_dof_indices (std::vector // not allocated for this // non-active thing Assert (!this->has_children() || - (this->get_fe().dofs_per_cell == - 2*this->get_fe().dofs_per_vertex), + (this->dof_handler->get_fe().dofs_per_cell == + 2*this->dof_handler->get_fe().dofs_per_vertex), DoFAccessor >::ExcNotActive()); - const unsigned int dofs_per_vertex = this->get_fe().dofs_per_vertex, - dofs_per_line = this->get_fe().dofs_per_line; + const unsigned int dofs_per_vertex = this->dof_handler->get_fe().dofs_per_vertex, + dofs_per_line = this->dof_handler->get_fe().dofs_per_line; std::vector::iterator next = dof_indices.begin(); for (unsigned int vertex=0; vertex<2; ++vertex) for (unsigned int d=0; d >::dof_index (const unsigned int i) const DoFAccessor >::ExcInvalidObject()); // make sure a FE has been selected // and enough room was reserved - Assert (&this->get_fe() != 0, + Assert (&this->dof_handler->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); - Assert (iget_fe().dofs_per_quad, - ExcIndexRange (i, 0, this->get_fe().dofs_per_quad)); + Assert (idof_handler->get_fe().dofs_per_quad, + ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_quad)); Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("DoFHandler not initialized")); return this->dof_handler->levels[this->present_level] - ->quad_dofs[this->present_index*this->get_fe().dofs_per_quad+i]; + ->quad_dofs[this->present_index*this->dof_handler->get_fe().dofs_per_quad+i]; } @@ -753,16 +660,16 @@ DoFObjectAccessor<2,DoFHandler<2> >::vertex_dof_index (const unsigned int vertex { Assert (this->dof_handler != 0, DoFAccessor >::ExcInvalidObject()); - Assert (&this->get_fe() != 0, + Assert (&this->dof_handler->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); Assert (vertex<4, ExcIndexRange (i,0,4)); - Assert (iget_fe().dofs_per_vertex, - ExcIndexRange (i, 0, this->get_fe().dofs_per_vertex)); + Assert (idof_handler->get_fe().dofs_per_vertex, + ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_vertex)); Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("DoFHandler not initialized")); const unsigned int dof_number = (this->vertex_index(vertex) * - this->get_fe().dofs_per_vertex + + this->dof_handler->get_fe().dofs_per_vertex + i); return this->dof_handler->vertex_dofs[dof_number]; } @@ -776,11 +683,11 @@ DoFObjectAccessor<2,DoFHandler<2> >::get_dof_indices (std::vector { Assert (this->dof_handler != 0, DoFAccessor >::ExcInvalidObject()); - Assert (&this->get_fe() != 0, + Assert (&this->dof_handler->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); - Assert (dof_indices.size() == (4*this->get_fe().dofs_per_vertex + - 4*this->get_fe().dofs_per_line + - this->get_fe().dofs_per_quad), + Assert (dof_indices.size() == (4*this->dof_handler->get_fe().dofs_per_vertex + + 4*this->dof_handler->get_fe().dofs_per_line + + this->dof_handler->get_fe().dofs_per_quad), DoFAccessor >::ExcVectorDoesNotMatch()); // this function really only makes @@ -792,16 +699,16 @@ DoFObjectAccessor<2,DoFHandler<2> >::get_dof_indices (std::vector // not allocated for this // non-active thing Assert (!this->has_children() || - (this->get_fe().dofs_per_cell == - 4*this->get_fe().dofs_per_vertex), + (this->dof_handler->get_fe().dofs_per_cell == + 4*this->dof_handler->get_fe().dofs_per_vertex), DoFAccessor >::ExcNotActive()); Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("DoFHandler not initialized")); - const unsigned int dofs_per_vertex = this->get_fe().dofs_per_vertex, - dofs_per_line = this->get_fe().dofs_per_line, - dofs_per_quad = this->get_fe().dofs_per_quad; + const unsigned int dofs_per_vertex = this->dof_handler->get_fe().dofs_per_vertex, + dofs_per_line = this->dof_handler->get_fe().dofs_per_line, + dofs_per_quad = this->dof_handler->get_fe().dofs_per_quad; std::vector::iterator next = dof_indices.begin(); for (unsigned int vertex=0; vertex<4; ++vertex) for (unsigned int d=0; d >::dof_index (const unsigned int i) const DoFAccessor >::ExcInvalidObject()); // make sure a FE has been selected // and enough room was reserved - Assert (&this->get_fe() != 0, + Assert (&this->dof_handler->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); - Assert (iget_fe().dofs_per_quad, - ExcIndexRange (i, 0, this->get_fe().dofs_per_quad)); + Assert (idof_handler->get_fe().dofs_per_quad, + ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_quad)); Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("DoFHandler not initialized")); return this->dof_handler->levels[this->present_level] - ->quad_dofs[this->present_index*this->get_fe().dofs_per_quad+i]; + ->quad_dofs[this->present_index*this->dof_handler->get_fe().dofs_per_quad+i]; } @@ -845,16 +752,16 @@ DoFObjectAccessor<2,DoFHandler<3> >::vertex_dof_index (const unsigned int vertex { Assert (this->dof_handler != 0, DoFAccessor >::ExcInvalidObject()); - Assert (&this->get_fe() != 0, + Assert (&this->dof_handler->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); Assert (vertex<4, ExcIndexRange (i,0,4)); - Assert (iget_fe().dofs_per_vertex, - ExcIndexRange (i, 0, this->get_fe().dofs_per_vertex)); + Assert (idof_handler->get_fe().dofs_per_vertex, + ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_vertex)); Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("DoFHandler not initialized")); const unsigned int dof_number = (this->vertex_index(vertex) * - this->get_fe().dofs_per_vertex + + this->dof_handler->get_fe().dofs_per_vertex + i); return this->dof_handler->vertex_dofs[dof_number]; } @@ -868,11 +775,11 @@ DoFObjectAccessor<2,DoFHandler<3> >::get_dof_indices (std::vector { Assert (this->dof_handler != 0, DoFAccessor >::ExcInvalidObject()); - Assert (&this->get_fe() != 0, + Assert (&this->dof_handler->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); - Assert (dof_indices.size() == (4*this->get_fe().dofs_per_vertex + - 4*this->get_fe().dofs_per_line + - this->get_fe().dofs_per_quad), + Assert (dof_indices.size() == (4*this->dof_handler->get_fe().dofs_per_vertex + + 4*this->dof_handler->get_fe().dofs_per_line + + this->dof_handler->get_fe().dofs_per_quad), DoFAccessor >::ExcVectorDoesNotMatch()); // this function really only makes @@ -884,16 +791,16 @@ DoFObjectAccessor<2,DoFHandler<3> >::get_dof_indices (std::vector // not allocated for this // non-active thing Assert (!this->has_children() || - (this->get_fe().dofs_per_cell == - 4*this->get_fe().dofs_per_vertex), + (this->dof_handler->get_fe().dofs_per_cell == + 4*this->dof_handler->get_fe().dofs_per_vertex), DoFAccessor >::ExcNotActive()); Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("DoFHandler not initialized")); - const unsigned int dofs_per_vertex = this->get_fe().dofs_per_vertex, - dofs_per_line = this->get_fe().dofs_per_line, - dofs_per_quad = this->get_fe().dofs_per_quad; + const unsigned int dofs_per_vertex = this->dof_handler->get_fe().dofs_per_vertex, + dofs_per_line = this->dof_handler->get_fe().dofs_per_line, + dofs_per_quad = this->dof_handler->get_fe().dofs_per_quad; std::vector::iterator next = dof_indices.begin(); for (unsigned int vertex=0; vertex<4; ++vertex) for (unsigned int d=0; d >::dof_index (const unsigned int i) const DoFAccessor >::ExcInvalidObject()); // make sure a FE has been selected // and enough room was reserved - Assert (&this->get_fe() != 0, + Assert (&this->dof_handler->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); - Assert (iget_fe().dofs_per_hex, - ExcIndexRange (i, 0, this->get_fe().dofs_per_hex)); + Assert (idof_handler->get_fe().dofs_per_hex, + ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_hex)); Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("DoFHandler not initialized")); return this->dof_handler->levels[this->present_level] - ->hex_dofs[this->present_index*this->get_fe().dofs_per_hex+i]; + ->hex_dofs[this->present_index*this->dof_handler->get_fe().dofs_per_hex+i]; } @@ -942,16 +849,16 @@ DoFObjectAccessor<3,DoFHandler<3> >::vertex_dof_index (const unsigned int vertex { Assert (this->dof_handler != 0, DoFAccessor >::ExcInvalidObject()); - Assert (&this->get_fe() != 0, + Assert (&this->dof_handler->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); Assert (vertex<8, ExcIndexRange (i,0,8)); - Assert (iget_fe().dofs_per_vertex, - ExcIndexRange (i, 0, this->get_fe().dofs_per_vertex)); + Assert (idof_handler->get_fe().dofs_per_vertex, + ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_vertex)); Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("DoFHandler not initialized")); const unsigned int dof_number = (this->vertex_index(vertex) * - this->get_fe().dofs_per_vertex + + this->dof_handler->get_fe().dofs_per_vertex + i); return this->dof_handler->vertex_dofs[dof_number]; } @@ -965,12 +872,12 @@ DoFObjectAccessor<3,DoFHandler<3> >::get_dof_indices (std::vector { Assert (this->dof_handler != 0, DoFAccessor >::ExcInvalidObject()); - Assert (&this->get_fe() != 0, + Assert (&this->dof_handler->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); - Assert (dof_indices.size() == (8*this->get_fe().dofs_per_vertex + - 12*this->get_fe().dofs_per_line + - 6*this->get_fe().dofs_per_quad + - this->get_fe().dofs_per_hex), + Assert (dof_indices.size() == (8*this->dof_handler->get_fe().dofs_per_vertex + + 12*this->dof_handler->get_fe().dofs_per_line + + 6*this->dof_handler->get_fe().dofs_per_quad + + this->dof_handler->get_fe().dofs_per_hex), DoFAccessor >::ExcVectorDoesNotMatch()); Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("DoFHandler not initialized")); @@ -984,16 +891,16 @@ DoFObjectAccessor<3,DoFHandler<3> >::get_dof_indices (std::vector // not allocated for this // non-active thing Assert (!this->has_children() || - (this->get_fe().dofs_per_cell == - 8*this->get_fe().dofs_per_vertex), + (this->dof_handler->get_fe().dofs_per_cell == + 8*this->dof_handler->get_fe().dofs_per_vertex), DoFAccessor >::ExcNotActive()); Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("DoFHandler not initialized")); - const unsigned int dofs_per_vertex = this->get_fe().dofs_per_vertex, - dofs_per_line = this->get_fe().dofs_per_line, - dofs_per_quad = this->get_fe().dofs_per_quad, - dofs_per_hex = this->get_fe().dofs_per_hex; + const unsigned int dofs_per_vertex = this->dof_handler->get_fe().dofs_per_vertex, + dofs_per_line = this->dof_handler->get_fe().dofs_per_line, + dofs_per_quad = this->dof_handler->get_fe().dofs_per_quad, + dofs_per_hex = this->dof_handler->get_fe().dofs_per_hex; std::vector::iterator next = dof_indices.begin(); for (unsigned int vertex=0; vertex<8; ++vertex) for (unsigned int d=0; d >::vertex_dof_index (const unsigned int ve ExcMessage ("hp::DoFHandler not initialized")); Assert (this->dof_handler != 0, DoFAccessor >::ExcInvalidObject()); - Assert (&this->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); + Assert (&this->dof_handler->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); Assert (vertex<2, ExcIndexRange (i,0,2)); - Assert (iget_fe().dofs_per_vertex, - ExcIndexRange (i, 0, this->get_fe().dofs_per_vertex)); + Assert (idof_handler->get_fe()[0].dofs_per_vertex, + ExcIndexRange (i, 0, this->dof_handler->get_fe()[0].dofs_per_vertex)); const unsigned int dof_number = (this->vertex_index(vertex) * - this->get_fe().dofs_per_vertex + + this->dof_handler->get_fe()[0].dofs_per_vertex + i); return this->dof_handler->vertex_dofs[dof_number]; } @@ -1045,13 +952,13 @@ DoFObjectAccessor<1,hp::DoFHandler<2> >::vertex_dof_index (const unsigned int ve ExcMessage ("hp::DoFHandler not initialized")); Assert (this->dof_handler != 0, DoFAccessor >::ExcInvalidObject()); - Assert (&this->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); + Assert (&this->dof_handler->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); Assert (vertex<2, ExcIndexRange (i,0,2)); - Assert (iget_fe().dofs_per_vertex, - ExcIndexRange (i, 0, this->get_fe().dofs_per_vertex)); + Assert (idof_handler->get_fe()[0].dofs_per_vertex, + ExcIndexRange (i, 0, this->dof_handler->get_fe()[0].dofs_per_vertex)); const unsigned int dof_number = (this->vertex_index(vertex) * - this->get_fe().dofs_per_vertex + + this->dof_handler->get_fe()[0].dofs_per_vertex + i); return this->dof_handler->vertex_dofs[dof_number]; } @@ -1067,13 +974,13 @@ DoFObjectAccessor<1,hp::DoFHandler<3> >::vertex_dof_index (const unsigned int ve ExcMessage ("hp::DoFHandler not initialized")); Assert (this->dof_handler != 0, DoFAccessor >::ExcInvalidObject()); - Assert (&this->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); + Assert (&this->dof_handler->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); Assert (vertex<2, ExcIndexRange (i,0,2)); - Assert (iget_fe().dofs_per_vertex, - ExcIndexRange (i, 0, this->get_fe().dofs_per_vertex)); + Assert (idof_handler->get_fe()[0].dofs_per_vertex, + ExcIndexRange (i, 0, this->dof_handler->get_fe()[0].dofs_per_vertex)); const unsigned int dof_number = (this->vertex_index(vertex) * - this->get_fe().dofs_per_vertex + + this->dof_handler->get_fe()[0].dofs_per_vertex + i); return this->dof_handler->vertex_dofs[dof_number]; } @@ -1087,16 +994,16 @@ DoFObjectAccessor<2,hp::DoFHandler<2> >::vertex_dof_index (const unsigned int ve { Assert (this->dof_handler != 0, DoFAccessor >::ExcInvalidObject()); - Assert (&this->get_fe() != 0, + Assert (&this->dof_handler->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); Assert (vertex<4, ExcIndexRange (i,0,4)); - Assert (iget_fe().dofs_per_vertex, - ExcIndexRange (i, 0, this->get_fe().dofs_per_vertex)); + Assert (idof_handler->get_fe()[0].dofs_per_vertex, + ExcIndexRange (i, 0, this->dof_handler->get_fe()[0].dofs_per_vertex)); Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("hp::DoFHandler not initialized")); const unsigned int dof_number = (this->vertex_index(vertex) * - this->get_fe().dofs_per_vertex + + this->dof_handler->get_fe()[0].dofs_per_vertex + i); return this->dof_handler->vertex_dofs[dof_number]; } @@ -1111,16 +1018,16 @@ DoFObjectAccessor<2,hp::DoFHandler<3> >::vertex_dof_index (const unsigned int ve { Assert (this->dof_handler != 0, DoFAccessor >::ExcInvalidObject()); - Assert (&this->get_fe() != 0, + Assert (&this->dof_handler->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); Assert (vertex<4, ExcIndexRange (i,0,4)); - Assert (iget_fe().dofs_per_vertex, - ExcIndexRange (i, 0, this->get_fe().dofs_per_vertex)); + Assert (idof_handler->get_fe()[0].dofs_per_vertex, + ExcIndexRange (i, 0, this->dof_handler->get_fe()[0].dofs_per_vertex)); Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("hp::DoFHandler not initialized")); const unsigned int dof_number = (this->vertex_index(vertex) * - this->get_fe().dofs_per_vertex + + this->dof_handler->get_fe()[0].dofs_per_vertex + i); return this->dof_handler->vertex_dofs[dof_number]; } @@ -1135,16 +1042,16 @@ DoFObjectAccessor<3,hp::DoFHandler<3> >::vertex_dof_index (const unsigned int ve { Assert (this->dof_handler != 0, DoFAccessor >::ExcInvalidObject()); - Assert (&this->get_fe() != 0, + Assert (&this->dof_handler->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); Assert (vertex<4, ExcIndexRange (i,0,4)); - Assert (iget_fe().dofs_per_vertex, - ExcIndexRange (i, 0, this->get_fe().dofs_per_vertex)); + Assert (idof_handler->get_fe()[0].dofs_per_vertex, + ExcIndexRange (i, 0, this->dof_handler->get_fe()[0].dofs_per_vertex)); Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("hp::DoFHandler not initialized")); const unsigned int dof_number = (this->vertex_index(vertex) * - this->get_fe().dofs_per_vertex + + this->dof_handler->get_fe()[0].dofs_per_vertex + i); return this->dof_handler->vertex_dofs[dof_number]; } @@ -1173,9 +1080,9 @@ DoFObjectAccessor<1,hp::DoFHandler<1> >::dof_index (const unsigned int i) const ExcMessage ("DoFHandler not initialized")); // make sure a FE has been selected // and enough room was reserved - Assert (&this->get_fe() != 0, BaseClass::ExcInvalidObject()); - Assert (iget_fe().dofs_per_line, - ExcIndexRange (i, 0, this->get_fe().dofs_per_line)); + Assert (&this->dof_handler->get_fe() != 0, BaseClass::ExcInvalidObject()); + Assert (idof_handler->get_fe()[0].dofs_per_line, + ExcIndexRange (i, 0, this->dof_handler->get_fe()[0].dofs_per_line)); // for lines in 1d, we only have to // take care of the offset, no @@ -1203,9 +1110,9 @@ DoFObjectAccessor<1,hp::DoFHandler<1> >::get_dof_indices (std::vectordof_handler != 0, DoFAccessor >::ExcInvalidObject()); - Assert (&this->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); - Assert (dof_indices.size() == (2*this->get_fe().dofs_per_vertex + - this->get_fe().dofs_per_line), + Assert (&this->dof_handler->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); + Assert (dof_indices.size() == (2*this->dof_handler->get_fe()[0].dofs_per_vertex + + this->dof_handler->get_fe()[0].dofs_per_line), DoFAccessor >::ExcVectorDoesNotMatch()); // this function really only makes @@ -1217,12 +1124,12 @@ DoFObjectAccessor<1,hp::DoFHandler<1> >::get_dof_indices (std::vectorhas_children() || - (this->get_fe().dofs_per_cell == - 2*this->get_fe().dofs_per_vertex), + (this->dof_handler->get_fe()[0].dofs_per_cell == + 2*this->dof_handler->get_fe()[0].dofs_per_vertex), DoFAccessor >::ExcNotActive()); - const unsigned int dofs_per_vertex = this->get_fe().dofs_per_vertex, - dofs_per_line = this->get_fe().dofs_per_line; + const unsigned int dofs_per_vertex = this->dof_handler->get_fe()[0].dofs_per_vertex, + dofs_per_line = this->dof_handler->get_fe()[0].dofs_per_line; std::vector::iterator next = dof_indices.begin(); for (unsigned int vertex=0; vertex<2; ++vertex) for (unsigned int d=0; d >::dof_index (const unsigned int i) const ExcMessage ("DoFHandler not initialized")); // make sure a FE has been selected // and enough room was reserved - Assert (&this->get_fe() != 0, BaseClass::ExcInvalidObject()); - Assert (iget_fe().dofs_per_line, - ExcIndexRange (i, 0, this->get_fe().dofs_per_line)); + Assert (&this->dof_handler->get_fe() != 0, BaseClass::ExcInvalidObject()); + Assert (idof_handler->get_fe()[0].dofs_per_line, + ExcIndexRange (i, 0, this->dof_handler->get_fe()[0].dofs_per_line)); const unsigned int offset = this->dof_handler->levels[this->present_level] ->dof_line_index_offset[this->present_index]; @@ -1280,9 +1187,9 @@ DoFObjectAccessor<1,hp::DoFHandler<2> >::get_dof_indices (std::vectordof_handler != 0, DoFAccessor >::ExcInvalidObject()); - Assert (&this->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); - Assert (dof_indices.size() == (2*this->get_fe().dofs_per_vertex + - this->get_fe().dofs_per_line), + Assert (&this->dof_handler->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); + Assert (dof_indices.size() == (2*this->dof_handler->get_fe()[0].dofs_per_vertex + + this->dof_handler->get_fe()[0].dofs_per_line), DoFAccessor >::ExcVectorDoesNotMatch()); // this function really only makes @@ -1294,12 +1201,12 @@ DoFObjectAccessor<1,hp::DoFHandler<2> >::get_dof_indices (std::vectorhas_children() || - (this->get_fe().dofs_per_cell == - 2*this->get_fe().dofs_per_vertex), + (this->dof_handler->get_fe()[0].dofs_per_cell == + 2*this->dof_handler->get_fe()[0].dofs_per_vertex), DoFAccessor >::ExcNotActive()); - const unsigned int dofs_per_vertex = this->get_fe().dofs_per_vertex, - dofs_per_line = this->get_fe().dofs_per_line; + const unsigned int dofs_per_vertex = this->dof_handler->get_fe()[0].dofs_per_vertex, + dofs_per_line = this->dof_handler->get_fe()[0].dofs_per_line; std::vector::iterator next = dof_indices.begin(); for (unsigned int vertex=0; vertex<2; ++vertex) for (unsigned int d=0; d >::dof_index (const unsigned int i) const ExcMessage ("DoFHandler not initialized")); // make sure a FE has been selected // and enough room was reserved - Assert (&this->get_fe() != 0, BaseClass::ExcInvalidObject()); - Assert (iget_fe().dofs_per_line, - ExcIndexRange (i, 0, this->get_fe().dofs_per_line)); + Assert (&this->dof_handler->get_fe() != 0, BaseClass::ExcInvalidObject()); + Assert (idof_handler->get_fe()[0].dofs_per_line, + ExcIndexRange (i, 0, this->dof_handler->get_fe()[0].dofs_per_line)); const unsigned int offset = this->dof_handler->levels[this->present_level] ->dof_line_index_offset[this->present_index]; @@ -1357,9 +1264,9 @@ DoFObjectAccessor<1,hp::DoFHandler<3> >::get_dof_indices (std::vectordof_handler != 0, DoFAccessor >::ExcInvalidObject()); - Assert (&this->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); - Assert (dof_indices.size() == (2*this->get_fe().dofs_per_vertex + - this->get_fe().dofs_per_line), + Assert (&this->dof_handler->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); + Assert (dof_indices.size() == (2*this->dof_handler->get_fe()[0].dofs_per_vertex + + this->dof_handler->get_fe()[0].dofs_per_line), DoFAccessor >::ExcVectorDoesNotMatch()); // this function really only makes @@ -1371,12 +1278,12 @@ DoFObjectAccessor<1,hp::DoFHandler<3> >::get_dof_indices (std::vectorhas_children() || - (this->get_fe().dofs_per_cell == - 2*this->get_fe().dofs_per_vertex), + (this->dof_handler->get_fe()[0].dofs_per_cell == + 2*this->dof_handler->get_fe()[0].dofs_per_vertex), DoFAccessor >::ExcNotActive()); - const unsigned int dofs_per_vertex = this->get_fe().dofs_per_vertex, - dofs_per_line = this->get_fe().dofs_per_line; + const unsigned int dofs_per_vertex = this->dof_handler->get_fe()[0].dofs_per_vertex, + dofs_per_line = this->dof_handler->get_fe()[0].dofs_per_line; std::vector::iterator next = dof_indices.begin(); for (unsigned int vertex=0; vertex<2; ++vertex) for (unsigned int d=0; d >::set_dof_index (const unsigned int i, ExcMessage ("DoFHandler not initialized")); // make sure a FE has been selected // and enough room was reserved - Assert (&this->get_fe() != 0, + Assert (&this->dof_handler->get_fe() != 0, BaseClass::ExcInvalidObject()); - Assert (iget_fe().dofs_per_line, - ExcIndexRange (i, 0, this->get_fe().dofs_per_line)); + Assert (idof_handler->get_fe()[0].dofs_per_line, + ExcIndexRange (i, 0, this->dof_handler->get_fe()[0].dofs_per_line)); // for lines in 1d, we only have to // take care of the offset, no @@ -1437,10 +1344,10 @@ DoFObjectAccessor<1, hp::DoFHandler<2> >::set_dof_index (const unsigned int i, ExcMessage ("DoFHandler not initialized")); // make sure a FE has been selected // and enough room was reserved - Assert (&this->get_fe() != 0, + Assert (&this->dof_handler->get_fe() != 0, BaseClass::ExcInvalidObject()); - Assert (iget_fe().dofs_per_line, - ExcIndexRange (i, 0, this->get_fe().dofs_per_line)); + Assert (idof_handler->get_fe()[0].dofs_per_line, + ExcIndexRange (i, 0, this->dof_handler->get_fe()[0].dofs_per_line)); //TODO:[?] In two dimension it could happen that we have different active_fe_indices // on a line between to cells. Hence we have to differentiate between these two cases. @@ -1473,10 +1380,10 @@ DoFObjectAccessor<1, hp::DoFHandler<3> >::set_dof_index (const unsigned int i, ExcMessage ("DoFHandler not initialized")); // make sure a FE has been selected // and enough room was reserved - Assert (&this->get_fe() != 0, + Assert (&this->dof_handler->get_fe() != 0, BaseClass::ExcInvalidObject()); - Assert (iget_fe().dofs_per_line, - ExcIndexRange (i, 0, this->get_fe().dofs_per_line)); + Assert (idof_handler->get_fe()[0].dofs_per_line, + ExcIndexRange (i, 0, this->dof_handler->get_fe()[0].dofs_per_line)); const unsigned int offset = this->dof_handler->levels[this->present_level] ->dof_line_index_offset[this->present_index]; @@ -1492,129 +1399,6 @@ DoFObjectAccessor<1, hp::DoFHandler<3> >::set_dof_index (const unsigned int i, -template <> -inline -const FiniteElement<1> & -DoFObjectAccessor<1,hp::DoFHandler<1> >::get_fe () const -{ - return (*dof_handler->finite_elements)[active_fe_index ()]; -} - - - -template <> -inline -const FiniteElement<2> & -DoFObjectAccessor<1,hp::DoFHandler<2> >::get_fe () const -{ - Assert (false, ExcMessage ("Only cells, not lower-dimensional objects, are " - "associated with active_fe_indices and corresponding " - "finite element objects")); - return (*dof_handler->finite_elements)[0]; -} - - - -template <> -inline -const FiniteElement<3> & -DoFObjectAccessor<1,hp::DoFHandler<3> >::get_fe () const -{ - Assert (false, ExcMessage ("Only cells, not lower-dimensional objects, are " - "associated with active_fe_indices and corresponding " - "finite element objects")); - return (*dof_handler->finite_elements)[0]; -} - - - -template <> -inline -unsigned int -DoFObjectAccessor<1,hp::DoFHandler<1> >::active_fe_index () const -{ - Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), - ExcMessage ("DoFHandler not initialized")); - Assert (static_cast::size_type>(this->present_index) < - this->dof_handler->levels[this->present_level]->active_fe_indices.size (), - ExcIndexRange (this->present_index, 0, - this->dof_handler->levels[this->present_level]->active_fe_indices.size ())); - return this->dof_handler->levels[this->present_level] - ->active_fe_indices[this->present_index]; -} - - - -template <> -inline -unsigned int -DoFObjectAccessor<1,hp::DoFHandler<2> >::active_fe_index () const -{ - Assert (false, ExcMessage ("Only cells, not lower-dimensional objects, are " - "associated with active_fe_indices and corresponding " - "finite element objects")); - return 0; -} - - - -template <> -inline -unsigned int -DoFObjectAccessor<1,hp::DoFHandler<3> >::active_fe_index () const -{ - Assert (false, ExcMessage ("Only cells, not lower-dimensional objects, are " - "associated with active_fe_indices and corresponding " - "finite element objects")); - return 0; -} - - - -template <> -inline -void -DoFObjectAccessor<1,hp::DoFHandler<1> >::set_active_fe_index (const unsigned int i) -{ - Assert (this->dof_handler != 0, ExcInvalidObject()); - Assert (static_cast(this->present_level) < - this->dof_handler->levels.size(), - ExcMessage ("DoFHandler not initialized")); - Assert (static_cast::size_type>(this->present_index) < - this->dof_handler->levels[this->present_level]->active_fe_indices.size (), - ExcIndexRange (this->present_index, 0, - this->dof_handler->levels[this->present_level]->active_fe_indices.size ())); - Assert (i < this->dof_handler->finite_elements->size (), - ExcIndexRange(i, 0, this->dof_handler->finite_elements->size ())); - this->dof_handler->levels[this->present_level] - ->active_fe_indices[this->present_index] = i; -} - - - -template <> -inline -void -DoFObjectAccessor<1,hp::DoFHandler<2> >::set_active_fe_index (const unsigned int) -{ - Assert (false, ExcMessage ("Only cells, not lower-dimensional objects, are " - "associated with active_fe_indices and corresponding " - "finite element objects")); -} - - - -template <> -inline -void -DoFObjectAccessor<1,hp::DoFHandler<3> >::set_active_fe_index (const unsigned int) -{ - Assert (false, ExcMessage ("Only cells, not lower-dimensional objects, are " - "associated with active_fe_indices and corresponding " - "finite element objects")); -} - - /*------------- Functions: DoFObjectAccessor<2,hp::DoFHandler> -------------*/ template <> @@ -1629,10 +1413,10 @@ unsigned int DoFObjectAccessor<2,hp::DoFHandler<2> >::dof_index (const unsigned ExcMessage ("DoFHandler not initialized")); // make sure a FE has been selected // and enough room was reserved - Assert (&this->get_fe() != 0, + Assert (&this->dof_handler->get_fe() != 0, BaseClass::ExcInvalidObject()); - Assert (iget_fe().dofs_per_quad, - ExcIndexRange (i, 0, this->get_fe().dofs_per_quad)); + Assert (idof_handler->get_fe()[0].dofs_per_quad, + ExcIndexRange (i, 0, this->dof_handler->get_fe()[0].dofs_per_quad)); // for quads in 2d, we only have to // take care of the offset, no @@ -1663,10 +1447,10 @@ unsigned int DoFObjectAccessor<2,hp::DoFHandler<3> >::dof_index (const unsigned ExcMessage ("DoFHandler not initialized")); // make sure a FE has been selected // and enough room was reserved - Assert (&this->get_fe() != 0, + Assert (&this->dof_handler->get_fe() != 0, BaseClass::ExcInvalidObject()); - Assert (iget_fe().dofs_per_quad, - ExcIndexRange (i, 0, this->get_fe().dofs_per_quad)); + Assert (idof_handler->get_fe()[0].dofs_per_quad, + ExcIndexRange (i, 0, this->dof_handler->get_fe()[0].dofs_per_quad)); const unsigned int offset = this->dof_handler->levels[this->present_level] ->dof_quad_index_offset[this->present_index]; @@ -1695,10 +1479,10 @@ DoFObjectAccessor<2, hp::DoFHandler<2> >::set_dof_index (const unsigned int i, ExcMessage ("DoFHandler not initialized")); // make sure a FE has been selected // and enough room was reserved - Assert (&this->get_fe() != 0, + Assert (&this->dof_handler->get_fe() != 0, BaseClass::ExcInvalidObject()); - Assert (iget_fe().dofs_per_quad, - ExcIndexRange (i, 0, this->get_fe().dofs_per_quad)); + Assert (idof_handler->get_fe()[0].dofs_per_quad, + ExcIndexRange (i, 0, this->dof_handler->get_fe()[0].dofs_per_quad)); // for quads in 2d, we only have to // take care of the offset, no @@ -1731,10 +1515,10 @@ DoFObjectAccessor<2, hp::DoFHandler<3> >::set_dof_index (const unsigned int i, ExcMessage ("DoFHandler not initialized")); // make sure a FE has been selected // and enough room was reserved - Assert (&this->get_fe() != 0, + Assert (&this->dof_handler->get_fe() != 0, BaseClass::ExcInvalidObject()); - Assert (iget_fe().dofs_per_quad, - ExcIndexRange (i, 0, this->get_fe().dofs_per_quad)); + Assert (idof_handler->get_fe()[0].dofs_per_quad, + ExcIndexRange (i, 0, this->dof_handler->get_fe()[0].dofs_per_quad)); const unsigned int offset = this->dof_handler->levels[this->present_level] ->dof_quad_index_offset[this->present_index]; @@ -1756,11 +1540,11 @@ DoFObjectAccessor<2,hp::DoFHandler<2> >::get_dof_indices (std::vectordof_handler != 0, DoFAccessor >::ExcInvalidObject()); - Assert (&this->get_fe() != 0, + Assert (&this->dof_handler->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); - Assert (dof_indices.size() == (4*this->get_fe().dofs_per_vertex + - 4*this->get_fe().dofs_per_line + - this->get_fe().dofs_per_quad), + Assert (dof_indices.size() == (4*this->dof_handler->get_fe()[0].dofs_per_vertex + + 4*this->dof_handler->get_fe()[0].dofs_per_line + + this->dof_handler->get_fe()[0].dofs_per_quad), DoFAccessor >::ExcVectorDoesNotMatch()); // this function really only makes @@ -1772,16 +1556,16 @@ DoFObjectAccessor<2,hp::DoFHandler<2> >::get_dof_indices (std::vectorhas_children() || - (this->get_fe().dofs_per_cell == - 4*this->get_fe().dofs_per_vertex), + (this->dof_handler->get_fe()[0].dofs_per_cell == + 4*this->dof_handler->get_fe()[0].dofs_per_vertex), DoFAccessor >::ExcNotActive()); Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("DoFHandler not initialized")); - const unsigned int dofs_per_vertex = this->get_fe().dofs_per_vertex, - dofs_per_line = this->get_fe().dofs_per_line, - dofs_per_quad = this->get_fe().dofs_per_quad; + const unsigned int dofs_per_vertex = this->dof_handler->get_fe()[0].dofs_per_vertex, + dofs_per_line = this->dof_handler->get_fe()[0].dofs_per_line, + dofs_per_quad = this->dof_handler->get_fe()[0].dofs_per_quad; std::vector::iterator next = dof_indices.begin(); for (unsigned int vertex=0; vertex<4; ++vertex) for (unsigned int d=0; d >::get_dof_indices (std::vectordof_handler != 0, DoFAccessor >::ExcInvalidObject()); - Assert (&this->get_fe() != 0, + Assert (&this->dof_handler->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); - Assert (dof_indices.size() == (4*this->get_fe().dofs_per_vertex + - 4*this->get_fe().dofs_per_line + - this->get_fe().dofs_per_quad), + Assert (dof_indices.size() == (4*this->dof_handler->get_fe()[0].dofs_per_vertex + + 4*this->dof_handler->get_fe()[0].dofs_per_line + + this->dof_handler->get_fe()[0].dofs_per_quad), DoFAccessor >::ExcVectorDoesNotMatch()); // this function really only makes @@ -1818,16 +1602,16 @@ DoFObjectAccessor<2,hp::DoFHandler<3> >::get_dof_indices (std::vectorhas_children() || - (this->get_fe().dofs_per_cell == - 4*this->get_fe().dofs_per_vertex), + (this->dof_handler->get_fe()[0].dofs_per_cell == + 4*this->dof_handler->get_fe()[0].dofs_per_vertex), DoFAccessor >::ExcNotActive()); Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("DoFHandler not initialized")); - const unsigned int dofs_per_vertex = this->get_fe().dofs_per_vertex, - dofs_per_line = this->get_fe().dofs_per_line, - dofs_per_quad = this->get_fe().dofs_per_quad; + const unsigned int dofs_per_vertex = this->dof_handler->get_fe()[0].dofs_per_vertex, + dofs_per_line = this->dof_handler->get_fe()[0].dofs_per_line, + dofs_per_quad = this->dof_handler->get_fe()[0].dofs_per_quad; std::vector::iterator next = dof_indices.begin(); for (unsigned int vertex=0; vertex<4; ++vertex) for (unsigned int d=0; d >::get_dof_indices (std::vector -inline -const FiniteElement<2> & -DoFObjectAccessor<2,hp::DoFHandler<2> >::get_fe () const -{ - return (*dof_handler->finite_elements)[active_fe_index ()]; -} - - - -template <> -inline -const FiniteElement<3> & -DoFObjectAccessor<2,hp::DoFHandler<3> >::get_fe () const -{ - Assert (false, ExcMessage ("Only cells, not lower-dimensional objects, are " - "associated with active_fe_indices and corresponding " - "finite element objects")); - return (*dof_handler->finite_elements)[0]; -} - - - - -template <> -inline -unsigned int -DoFObjectAccessor<2,hp::DoFHandler<2> >::active_fe_index () const -{ - Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), - ExcMessage ("DoFHandler not initialized")); - Assert (static_cast::size_type>(this->present_index) < - this->dof_handler->levels[this->present_level]->active_fe_indices.size (), - ExcIndexRange (this->present_index, 0, - this->dof_handler->levels[this->present_level]->active_fe_indices.size ())); - return this->dof_handler->levels[this->present_level] - ->active_fe_indices[this->present_index]; -} - - - - -template <> -inline -unsigned int -DoFObjectAccessor<2,hp::DoFHandler<3> >::active_fe_index () const -{ - Assert (false, ExcMessage ("Only cells, not lower-dimensional objects, are " - "associated with active_fe_indices and corresponding " - "finite element objects")); - return 0; -} - - - -template <> -inline -void -DoFObjectAccessor<2,hp::DoFHandler<2> >::set_active_fe_index (const unsigned int i) -{ - Assert (this->dof_handler != 0, ExcInvalidObject()); - Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), - ExcMessage ("DoFHandler not initialized")); - Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), - ExcMessage ("DoFHandler not initialized")); - Assert (static_cast::size_type>(this->present_index) < - this->dof_handler->levels[this->present_level]->active_fe_indices.size (), - ExcIndexRange (this->present_index, 0, - this->dof_handler->levels[this->present_level]->active_fe_indices.size ())); - Assert (i < this->dof_handler->finite_elements->size (), - ExcIndexRange(i, 0, this->dof_handler->finite_elements->size ())); - - this->dof_handler->levels[this->present_level] - ->active_fe_indices[this->present_index] = i; -} - - - -template <> -inline -void -DoFObjectAccessor<2,hp::DoFHandler<3> >::set_active_fe_index (const unsigned int) -{ - Assert (false, ExcMessage ("Only cells, not lower-dimensional objects, are " - "associated with active_fe_indices and corresponding " - "finite element objects")); -} /*------------- Functions: DoFObjectAccessor<3,hp::DoFHandler> -------------*/ @@ -1945,10 +1642,10 @@ DoFObjectAccessor<3,hp::DoFHandler<3> >::dof_index (const unsigned int i) const ExcMessage ("DoFHandler not initialized")); // make sure a FE has been selected // and enough room was reserved - Assert (&this->get_fe() != 0, + Assert (&this->dof_handler->get_fe() != 0, BaseClass::ExcInvalidObject()); - Assert (iget_fe().dofs_per_hex, - ExcIndexRange (i, 0, this->get_fe().dofs_per_hex)); + Assert (idof_handler->get_fe()[0].dofs_per_hex, + ExcIndexRange (i, 0, this->dof_handler->get_fe()[0].dofs_per_hex)); // for hexes in 3d, we only have to // take care of the offset, no @@ -1981,10 +1678,10 @@ DoFObjectAccessor<3, hp::DoFHandler<3> >::set_dof_index (const unsigned int i, ExcMessage ("DoFHandler not initialized")); // make sure a FE has been selected // and enough room was reserved - Assert (&this->get_fe() != 0, + Assert (&this->dof_handler->get_fe() != 0, BaseClass::ExcInvalidObject()); - Assert (iget_fe().dofs_per_hex, - ExcIndexRange (i, 0, this->get_fe().dofs_per_hex)); + Assert (idof_handler->get_fe()[0].dofs_per_hex, + ExcIndexRange (i, 0, this->dof_handler->get_fe()[0].dofs_per_hex)); // for hexes in 3d, we only have to // take care of the offset, no @@ -2010,12 +1707,12 @@ DoFObjectAccessor<3,hp::DoFHandler<3> >::get_dof_indices (std::vectordof_handler != 0, DoFAccessor >::ExcInvalidObject()); - Assert (&this->get_fe() != 0, + Assert (&this->dof_handler->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); - Assert (dof_indices.size() == (8*this->get_fe().dofs_per_vertex + - 12*this->get_fe().dofs_per_line + - 6*this->get_fe().dofs_per_quad + - this->get_fe().dofs_per_hex), + Assert (dof_indices.size() == (8*this->dof_handler->get_fe()[0].dofs_per_vertex + + 12*this->dof_handler->get_fe()[0].dofs_per_line + + 6*this->dof_handler->get_fe()[0].dofs_per_quad + + this->dof_handler->get_fe()[0].dofs_per_hex), DoFAccessor >::ExcVectorDoesNotMatch()); Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("DoFHandler not initialized")); @@ -2029,16 +1726,16 @@ DoFObjectAccessor<3,hp::DoFHandler<3> >::get_dof_indices (std::vectorhas_children() || - (this->get_fe().dofs_per_cell == - 8*this->get_fe().dofs_per_vertex), + (this->dof_handler->get_fe()[0].dofs_per_cell == + 8*this->dof_handler->get_fe()[0].dofs_per_vertex), DoFAccessor >::ExcNotActive()); Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("DoFHandler not initialized")); - const unsigned int dofs_per_vertex = this->get_fe().dofs_per_vertex, - dofs_per_line = this->get_fe().dofs_per_line, - dofs_per_quad = this->get_fe().dofs_per_quad, - dofs_per_hex = this->get_fe().dofs_per_hex; + const unsigned int dofs_per_vertex = this->dof_handler->get_fe()[0].dofs_per_vertex, + dofs_per_line = this->dof_handler->get_fe()[0].dofs_per_line, + dofs_per_quad = this->dof_handler->get_fe()[0].dofs_per_quad, + dofs_per_hex = this->dof_handler->get_fe()[0].dofs_per_hex; std::vector::iterator next = dof_indices.begin(); for (unsigned int vertex=0; vertex<8; ++vertex) for (unsigned int d=0; d >::get_dof_indices (std::vector -inline -const FiniteElement<3> & -DoFObjectAccessor<3,hp::DoFHandler<3> >::get_fe () const -{ - return (*dof_handler->finite_elements)[active_fe_index ()]; -} - - - -template <> -inline -unsigned int -DoFObjectAccessor<3,hp::DoFHandler<3> >::active_fe_index () const -{ - Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), - ExcMessage ("DoFHandler not initialized")); - Assert (static_cast::size_type>(this->present_index) < - this->dof_handler->levels[this->present_level]->active_fe_indices.size (), - ExcIndexRange (this->present_index, 0, - this->dof_handler->levels[this->present_level]->active_fe_indices.size ())); - return this->dof_handler->levels[this->present_level] - ->active_fe_indices[this->present_index]; -} - - - -template <> -inline -void -DoFObjectAccessor<3,hp::DoFHandler<3> >::set_active_fe_index (const unsigned int i) -{ - Assert (this->dof_handler != 0, ExcInvalidObject()); - Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), - ExcMessage ("DoFHandler not initialized")); - Assert (static_cast::size_type>(this->present_index) < - this->dof_handler->levels[this->present_level]->active_fe_indices.size (), - ExcIndexRange (this->present_index, 0, - this->dof_handler->levels[this->present_level]->active_fe_indices.size ())); - Assert (i < this->dof_handler->finite_elements->size (), - ExcIndexRange(i, 0, this->dof_handler->finite_elements->size ())); - - this->dof_handler->levels[this->present_level] - ->active_fe_indices[this->present_index] = i; -} - - /*------------------------- Functions: DoFCellAccessor -----------------------*/ @@ -2288,6 +1938,185 @@ get_dof_indices (std::vector &dof_indices) const +template +inline +const FiniteElement & +DoFCellAccessor::get_fe () const +{ + return this->dof_handler->get_fe(); +} + + + +template +inline +unsigned int +DoFCellAccessor::active_fe_index () const +{ + return 0; +} + + + +template +inline +void +DoFCellAccessor::set_active_fe_index (const unsigned int i) +{ + Assert (i == 0, typename DoFAccessor::ExcInvalidObject()); +} + + + + + +template <> +inline +const FiniteElement<1> & +DoFCellAccessor >::get_fe () const +{ + return this->dof_handler->get_fe()[active_fe_index ()]; +} + + + +template <> +inline +const FiniteElement<2> & +DoFCellAccessor >::get_fe () const +{ + return this->dof_handler->get_fe()[active_fe_index ()]; +} + + + +template <> +inline +const FiniteElement<3> & +DoFCellAccessor >::get_fe () const +{ + return this->dof_handler->get_fe()[active_fe_index ()]; +} + + + +template <> +inline +unsigned int +DoFCellAccessor >::active_fe_index () const +{ + Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), + ExcMessage ("DoFHandler not initialized")); + Assert (static_cast::size_type>(this->present_index) < + this->dof_handler->levels[this->present_level]->active_fe_indices.size (), + ExcIndexRange (this->present_index, 0, + this->dof_handler->levels[this->present_level]->active_fe_indices.size ())); + return this->dof_handler->levels[this->present_level] + ->active_fe_indices[this->present_index]; +} + + + +template <> +inline +unsigned int +DoFCellAccessor >::active_fe_index () const +{ + Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), + ExcMessage ("DoFHandler not initialized")); + Assert (static_cast::size_type>(this->present_index) < + this->dof_handler->levels[this->present_level]->active_fe_indices.size (), + ExcIndexRange (this->present_index, 0, + this->dof_handler->levels[this->present_level]->active_fe_indices.size ())); + return this->dof_handler->levels[this->present_level] + ->active_fe_indices[this->present_index]; +} + + + +template <> +inline +unsigned int +DoFCellAccessor >::active_fe_index () const +{ + Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), + ExcMessage ("DoFHandler not initialized")); + Assert (static_cast::size_type>(this->present_index) < + this->dof_handler->levels[this->present_level]->active_fe_indices.size (), + ExcIndexRange (this->present_index, 0, + this->dof_handler->levels[this->present_level]->active_fe_indices.size ())); + return this->dof_handler->levels[this->present_level] + ->active_fe_indices[this->present_index]; +} + + + +template <> +inline +void +DoFCellAccessor >::set_active_fe_index (const unsigned int i) +{ + Assert (this->dof_handler != 0, + DoFAccessor >::ExcInvalidObject()); + Assert (static_cast(this->present_level) < + this->dof_handler->levels.size(), + ExcMessage ("DoFHandler not initialized")); + Assert (static_cast::size_type>(this->present_index) < + this->dof_handler->levels[this->present_level]->active_fe_indices.size (), + ExcIndexRange (this->present_index, 0, + this->dof_handler->levels[this->present_level]->active_fe_indices.size ())); + Assert (i < this->dof_handler->get_fe().size (), + ExcIndexRange(i, 0, this->dof_handler->get_fe().size ())); + this->dof_handler->levels[this->present_level] + ->active_fe_indices[this->present_index] = i; +} + + + +template <> +inline +void +DoFCellAccessor >::set_active_fe_index (const unsigned int i) +{ + Assert (this->dof_handler != 0, + DoFAccessor >::ExcInvalidObject()); + Assert (static_cast(this->present_level) < + this->dof_handler->levels.size(), + ExcMessage ("DoFHandler not initialized")); + Assert (static_cast::size_type>(this->present_index) < + this->dof_handler->levels[this->present_level]->active_fe_indices.size (), + ExcIndexRange (this->present_index, 0, + this->dof_handler->levels[this->present_level]->active_fe_indices.size ())); + Assert (i < this->dof_handler->get_fe().size (), + ExcIndexRange(i, 0, this->dof_handler->get_fe().size ())); + this->dof_handler->levels[this->present_level] + ->active_fe_indices[this->present_index] = i; +} + + + +template <> +inline +void +DoFCellAccessor >::set_active_fe_index (const unsigned int i) +{ + Assert (this->dof_handler != 0, + DoFAccessor >::ExcInvalidObject()); + Assert (static_cast(this->present_level) < + this->dof_handler->levels.size(), + ExcMessage ("DoFHandler not initialized")); + Assert (static_cast::size_type>(this->present_index) < + this->dof_handler->levels[this->present_level]->active_fe_indices.size (), + ExcIndexRange (this->present_index, 0, + this->dof_handler->levels[this->present_level]->active_fe_indices.size ())); + Assert (i < this->dof_handler->get_fe().size (), + ExcIndexRange(i, 0, this->dof_handler->get_fe().size ())); + this->dof_handler->levels[this->present_level] + ->active_fe_indices[this->present_index] = i; +} + + + template <> inline void @@ -2323,8 +2152,7 @@ distribute_local_to_global (const Vector &local_source, typename BaseClass::ExcInvalidObject()); Assert (&this->get_fe() != 0, typename BaseClass::ExcInvalidObject()); - Assert (local_source.size() == (2*this->get_fe().dofs_per_vertex + - this->get_fe().dofs_per_line), + Assert (local_source.size() == this->get_fe().dofs_per_cell, typename BaseClass::ExcVectorDoesNotMatch()); Assert (this->dof_handler->n_dofs() == global_destination.size(), typename BaseClass::ExcVectorDoesNotMatch()); @@ -2367,8 +2195,7 @@ distribute_local_to_global (const FullMatrix &local_source, typename BaseClass::ExcInvalidObject()); Assert (&this->get_fe() != 0, typename BaseClass::ExcInvalidObject()); - Assert (local_source.m() == (2*this->get_fe().dofs_per_vertex + - this->get_fe().dofs_per_line), + Assert (local_source.m() == this->get_fe().dofs_per_cell, typename BaseClass::ExcVectorDoesNotMatch()); Assert (local_source.m() == local_source.n(), typename BaseClass::ExcMatrixDoesNotMatch()); diff --git a/deal.II/deal.II/include/dofs/hp_dof_handler.h b/deal.II/deal.II/include/dofs/hp_dof_handler.h index 6b1a7acc35..319720da78 100644 --- a/deal.II/deal.II/include/dofs/hp_dof_handler.h +++ b/deal.II/deal.II/include/dofs/hp_dof_handler.h @@ -1042,6 +1042,11 @@ namespace hp * Make accessor objects friends. */ template friend class ::DoFObjectAccessor; + + /** + * Make accessor objects friends. + */ + template friend class ::DoFCellAccessor; }; diff --git a/deal.II/deal.II/source/dofs/dof_accessor.cc b/deal.II/deal.II/source/dofs/dof_accessor.cc index 8c57ae088c..49ea3e7277 100644 --- a/deal.II/deal.II/source/dofs/dof_accessor.cc +++ b/deal.II/deal.II/source/dofs/dof_accessor.cc @@ -36,7 +36,7 @@ template void DoFObjectAccessor<1, DH>::set_dof_index (const unsigned int i, - const unsigned int index) const + const unsigned int index) const { typedef DoFAccessor BaseClass; @@ -44,21 +44,24 @@ void DoFObjectAccessor<1, DH>::set_dof_index (const unsigned int i, typename BaseClass::ExcInvalidObject()); // make sure a FE has been selected // and enough room was reserved - Assert (&this->get_fe() != 0, + Assert (&this->dof_handler->get_fe() != 0, typename BaseClass::ExcInvalidObject()); - Assert (iget_fe().dofs_per_line, - ExcIndexRange (i, 0, this->get_fe().dofs_per_line)); + Assert (idof_handler->get_fe().dofs_per_line, + ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_line)); this->dof_handler->levels[this->present_level] - ->line_dofs[this->present_index*this->get_fe().dofs_per_line+i] = index; + ->line_dofs[this->present_index*this->dof_handler->get_fe().dofs_per_line+i] + = index; } + + template void DoFObjectAccessor<1, DH>::set_vertex_dof_index (const unsigned int vertex, - const unsigned int i, - const unsigned int index) const + const unsigned int i, + const unsigned int index) const { // since the exception classes are @@ -74,14 +77,14 @@ void DoFObjectAccessor<1, DH>::set_vertex_dof_index (const unsigned int vertex, Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject()); - Assert (&this->get_fe() != 0, + Assert (&this->dof_handler->get_fe() != 0, typename BaseClass::ExcInvalidObject()); Assert (vertex<2, ExcIndexRange (i,0,2)); - Assert (iget_fe().dofs_per_vertex, - ExcIndexRange (i, 0, this->get_fe().dofs_per_vertex)); + Assert (idof_handler->get_fe().dofs_per_vertex, + ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_vertex)); const unsigned int dof_number = (this->vertex_index(vertex) * - this->get_fe().dofs_per_vertex + + this->dof_handler->get_fe().dofs_per_vertex + i); this->dof_handler->vertex_dofs[dof_number] = index; } @@ -92,24 +95,24 @@ template template void DoFObjectAccessor<1,DH>::get_dof_values (const InputVector &values, - Vector &local_values) const + Vector &local_values) const { typedef DoFAccessor BaseClass; Assert (dim==1, ExcInternalError()); Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject()); - Assert (&this->get_fe() != 0, + Assert (&this->dof_handler->get_fe() != 0, typename BaseClass::ExcInvalidObject()); - Assert (local_values.size() == this->get_fe().dofs_per_cell, + Assert (local_values.size() == this->dof_handler->get_fe().dofs_per_cell, typename BaseClass::ExcVectorDoesNotMatch()); Assert (values.size() == this->dof_handler->n_dofs(), typename BaseClass::ExcVectorDoesNotMatch()); Assert (this->has_children() == false, typename BaseClass::ExcNotActive()); - const unsigned int dofs_per_vertex = this->get_fe().dofs_per_vertex, - dofs_per_line = this->get_fe().dofs_per_line; + const unsigned int dofs_per_vertex = this->dof_handler->get_fe().dofs_per_vertex, + dofs_per_line = this->dof_handler->get_fe().dofs_per_line; typename Vector::iterator next_local_value=local_values.begin(); for (unsigned int vertex=0; vertex<2; ++vertex) for (unsigned int d=0; d template void DoFObjectAccessor<1,DH>::set_dof_values (const Vector &local_values, - OutputVector &values) const + OutputVector &values) const { typedef DoFAccessor BaseClass; Assert (dim==1, ExcInternalError()); Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject()); - Assert (&this->get_fe() != 0, + Assert (&this->dof_handler->get_fe() != 0, typename BaseClass::ExcInvalidObject()); - Assert (local_values.size() == this->get_fe().dofs_per_cell, + Assert (local_values.size() == this->dof_handler->get_fe().dofs_per_cell, typename BaseClass::ExcVectorDoesNotMatch()); Assert (values.size() == this->dof_handler->n_dofs(), typename BaseClass::ExcVectorDoesNotMatch()); Assert (this->has_children() == false, typename BaseClass::ExcNotActive()); - const unsigned int dofs_per_vertex = this->get_fe().dofs_per_vertex, - dofs_per_line = this->get_fe().dofs_per_line; + const unsigned int dofs_per_vertex = this->dof_handler->get_fe().dofs_per_vertex, + dofs_per_line = this->dof_handler->get_fe().dofs_per_line; typename Vector::const_iterator next_local_value=local_values.begin(); for (unsigned int vertex=0; vertex<2; ++vertex) for (unsigned int d=0; d::set_dof_values (const Vector &local_values, } + /*------------------------- Functions: DoFObjectAccessor<2,dim> -----------------------*/ template void DoFObjectAccessor<2, DH>::set_dof_index (const unsigned int i, - const unsigned int index) const + const unsigned int index) const { typedef DoFAccessor BaseClass; @@ -170,13 +174,13 @@ void DoFObjectAccessor<2, DH>::set_dof_index (const unsigned int i, typename BaseClass::ExcInvalidObject()); // make sure a FE has been selected // and enough room was reserved - Assert (&this->get_fe() != 0, + Assert (&this->dof_handler->get_fe() != 0, typename BaseClass::ExcInvalidObject()); - Assert (iget_fe().dofs_per_quad, - ExcIndexRange (i, 0, this->get_fe().dofs_per_quad)); + Assert (idof_handler->get_fe().dofs_per_quad, + ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_quad)); this->dof_handler->levels[this->present_level] - ->quad_dofs[this->present_index*this->get_fe().dofs_per_quad+i] = index; + ->quad_dofs[this->present_index*this->dof_handler->get_fe().dofs_per_quad+i] = index; } @@ -184,21 +188,21 @@ void DoFObjectAccessor<2, DH>::set_dof_index (const unsigned int i, template void DoFObjectAccessor<2, DH>::set_vertex_dof_index (const unsigned int vertex, - const unsigned int i, - const unsigned int index) const + const unsigned int i, + const unsigned int index) const { typedef DoFAccessor BaseClass; Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject()); - Assert (&this->get_fe() != 0, + Assert (&this->dof_handler->get_fe() != 0, typename BaseClass::ExcInvalidObject()); Assert (vertex<4, ExcIndexRange (i,0,4)); - Assert (iget_fe().dofs_per_vertex, - ExcIndexRange (i, 0, this->get_fe().dofs_per_vertex)); + Assert (idof_handler->get_fe().dofs_per_vertex, + ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_vertex)); const unsigned int dof_number = (this->vertex_index(vertex) * - this->get_fe().dofs_per_vertex + + this->dof_handler->get_fe().dofs_per_vertex + i); this->dof_handler->vertex_dofs[dof_number] = index; } @@ -209,7 +213,7 @@ template template void DoFObjectAccessor<2,DH>::get_dof_values (const InputVector &values, - Vector &local_values) const + Vector &local_values) const { typedef DoFAccessor BaseClass; @@ -217,18 +221,18 @@ DoFObjectAccessor<2,DH>::get_dof_values (const InputVector &values, Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject()); - Assert (&this->get_fe() != 0, + Assert (&this->dof_handler->get_fe() != 0, typename BaseClass::ExcInvalidObject()); - Assert (local_values.size() == this->get_fe().dofs_per_cell, + Assert (local_values.size() == this->dof_handler->get_fe().dofs_per_cell, typename BaseClass::ExcVectorDoesNotMatch()); Assert (values.size() == this->dof_handler->n_dofs(), typename BaseClass::ExcVectorDoesNotMatch()); Assert (this->has_children() == false, typename BaseClass::ExcNotActive()); - const unsigned int dofs_per_vertex = this->get_fe().dofs_per_vertex, - dofs_per_line = this->get_fe().dofs_per_line, - dofs_per_quad = this->get_fe().dofs_per_quad; + const unsigned int dofs_per_vertex = this->dof_handler->get_fe().dofs_per_vertex, + dofs_per_line = this->dof_handler->get_fe().dofs_per_line, + dofs_per_quad = this->dof_handler->get_fe().dofs_per_quad; typename Vector::iterator next_local_value=local_values.begin(); for (unsigned int vertex=0; vertex<4; ++vertex) for (unsigned int d=0; d template void DoFObjectAccessor<2,DH>::set_dof_values (const Vector &local_values, - OutputVector &values) const + OutputVector &values) const { typedef DoFAccessor BaseClass; @@ -257,18 +261,18 @@ DoFObjectAccessor<2,DH>::set_dof_values (const Vector &local_values, Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject()); - Assert (&this->get_fe() != 0, + Assert (&this->dof_handler->get_fe() != 0, typename BaseClass::ExcInvalidObject()); - Assert (local_values.size() == this->get_fe().dofs_per_cell, + Assert (local_values.size() == this->dof_handler->get_fe().dofs_per_cell, typename BaseClass::ExcVectorDoesNotMatch()); Assert (values.size() == this->dof_handler->n_dofs(), typename BaseClass::ExcVectorDoesNotMatch()); Assert (this->has_children() == false, typename BaseClass::ExcNotActive()); - const unsigned int dofs_per_vertex = this->get_fe().dofs_per_vertex, - dofs_per_line = this->get_fe().dofs_per_line, - dofs_per_quad = this->get_fe().dofs_per_quad; + const unsigned int dofs_per_vertex = this->dof_handler->get_fe().dofs_per_vertex, + dofs_per_line = this->dof_handler->get_fe().dofs_per_line, + dofs_per_quad = this->dof_handler->get_fe().dofs_per_quad; typename Vector::const_iterator next_local_value=local_values.begin(); for (unsigned int vertex=0; vertex<4; ++vertex) for (unsigned int d=0; d::set_dof_values (const Vector &local_values, template void DoFObjectAccessor<3, DH>::set_dof_index (const unsigned int i, - const unsigned int index) const + const unsigned int index) const { typedef DoFAccessor BaseClass; @@ -297,35 +301,35 @@ void DoFObjectAccessor<3, DH>::set_dof_index (const unsigned int i, typename BaseClass::ExcInvalidObject()); // make sure a FE has been selected // and enough room was reserved - Assert (&this->get_fe() != 0, + Assert (&this->dof_handler->get_fe() != 0, typename BaseClass::ExcInvalidObject()); - Assert (iget_fe().dofs_per_hex, - ExcIndexRange (i, 0, this->get_fe().dofs_per_hex)); + Assert (idof_handler->get_fe().dofs_per_hex, + ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_hex)); this->dof_handler->levels[this->present_level] - ->hex_dofs[this->present_index*this->get_fe().dofs_per_hex+i] = index; + ->hex_dofs[this->present_index*this->dof_handler->get_fe().dofs_per_hex+i] = index; } template void DoFObjectAccessor<3, DH>::set_vertex_dof_index (const unsigned int vertex, - const unsigned int i, - const unsigned int index) const + const unsigned int i, + const unsigned int index) const { typedef DoFAccessor BaseClass; Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject()); - Assert (&this->get_fe() != 0, + Assert (&this->dof_handler->get_fe() != 0, typename BaseClass::ExcInvalidObject()); Assert (vertex<8, ExcIndexRange (i,0,8)); - Assert (iget_fe().dofs_per_vertex, - ExcIndexRange (i, 0, this->get_fe().dofs_per_vertex)); + Assert (idof_handler->get_fe().dofs_per_vertex, + ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_vertex)); const unsigned int dof_number = (this->vertex_index(vertex) * - this->get_fe().dofs_per_vertex + + this->dof_handler->get_fe().dofs_per_vertex + i); this->dof_handler->vertex_dofs[dof_number] = index; } @@ -336,7 +340,7 @@ template template void DoFObjectAccessor<3,DH>::get_dof_values (const InputVector &values, - Vector &local_values) const + Vector &local_values) const { typedef DoFAccessor BaseClass; @@ -344,19 +348,19 @@ DoFObjectAccessor<3,DH>::get_dof_values (const InputVector &values, Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject()); - Assert (&this->get_fe() != 0, + Assert (&this->dof_handler->get_fe() != 0, typename BaseClass::ExcInvalidObject()); - Assert (local_values.size() == this->get_fe().dofs_per_cell, + Assert (local_values.size() == this->dof_handler->get_fe().dofs_per_cell, typename BaseClass::ExcVectorDoesNotMatch()); Assert (values.size() == this->dof_handler->n_dofs(), typename BaseClass::ExcVectorDoesNotMatch()); Assert (this->has_children() == false, typename BaseClass::ExcNotActive()); - const unsigned int dofs_per_vertex = this->get_fe().dofs_per_vertex, - dofs_per_line = this->get_fe().dofs_per_line, - dofs_per_quad = this->get_fe().dofs_per_quad, - dofs_per_hex = this->get_fe().dofs_per_hex; + const unsigned int dofs_per_vertex = this->dof_handler->get_fe().dofs_per_vertex, + dofs_per_line = this->dof_handler->get_fe().dofs_per_line, + dofs_per_quad = this->dof_handler->get_fe().dofs_per_quad, + dofs_per_hex = this->dof_handler->get_fe().dofs_per_hex; typename Vector::iterator next_local_value = local_values.begin(); for (unsigned int vertex=0; vertex::vertices_per_cell; ++vertex) for (unsigned int d=0; d template void DoFObjectAccessor<3,DH>::set_dof_values (const Vector &local_values, - OutputVector &values) const + OutputVector &values) const { typedef DoFAccessor BaseClass; @@ -388,19 +392,19 @@ DoFObjectAccessor<3,DH>::set_dof_values (const Vector &local_values, Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject()); - Assert (&this->get_fe() != 0, + Assert (&this->dof_handler->get_fe() != 0, typename BaseClass::ExcInvalidObject()); - Assert (local_values.size() == this->get_fe().dofs_per_cell, + Assert (local_values.size() == this->dof_handler->get_fe().dofs_per_cell, typename BaseClass::ExcVectorDoesNotMatch()); Assert (values.size() == this->dof_handler->n_dofs(), typename BaseClass::ExcVectorDoesNotMatch()); Assert (this->has_children() == false, typename BaseClass::ExcNotActive()); - const unsigned int dofs_per_vertex = this->get_fe().dofs_per_vertex, - dofs_per_line = this->get_fe().dofs_per_line, - dofs_per_quad = this->get_fe().dofs_per_quad, - dofs_per_hex = this->get_fe().dofs_per_hex; + const unsigned int dofs_per_vertex = this->dof_handler->get_fe().dofs_per_vertex, + dofs_per_line = this->dof_handler->get_fe().dofs_per_line, + dofs_per_quad = this->dof_handler->get_fe().dofs_per_quad, + dofs_per_hex = this->dof_handler->get_fe().dofs_per_hex; typename Vector::const_iterator next_local_value=local_values.begin(); for (unsigned int vertex=0; vertex::vertices_per_cell; ++vertex) for (unsigned int d=0; d::set_dof_values (const Vector &local_values, } + +// --------------- hp::DoFHandler specializations for 1d objects ----------- + + +template <> +void DoFObjectAccessor<1, hp::DoFHandler<1> >::set_vertex_dof_index (const unsigned int /*vertex*/, + const unsigned int /*i*/, + const unsigned int /*index*/) const +{ + Assert (false, ExcInternalError()); +} + +template <> +void DoFObjectAccessor<1, hp::DoFHandler<2> >::set_vertex_dof_index (const unsigned int /*vertex*/, + const unsigned int /*i*/, + const unsigned int /*index*/) const +{ + Assert (false, ExcInternalError()); +} + +template <> +void DoFObjectAccessor<1, hp::DoFHandler<3> >::set_vertex_dof_index (const unsigned int /*vertex*/, + const unsigned int /*i*/, + const unsigned int /*index*/) const +{ + Assert (false, ExcInternalError()); +} + + +template <> +template +void +DoFObjectAccessor<1,hp::DoFHandler<1> >::get_dof_values (const InputVector &/*values*/, + Vector &/*local_values*/) const +{ + Assert (false, ExcNotImplemented()); +} + +template <> +template +void +DoFObjectAccessor<1,hp::DoFHandler<2> >::get_dof_values (const InputVector &/*values*/, + Vector &/*local_values*/) const +{ + Assert (false, ExcNotImplemented()); +} + +template <> +template +void +DoFObjectAccessor<1,hp::DoFHandler<3> >::get_dof_values (const InputVector &/*values*/, + Vector &/*local_values*/) const +{ + Assert (false, ExcNotImplemented()); +} + + +template <> +template +void +DoFObjectAccessor<1,hp::DoFHandler<1> >::set_dof_values (const Vector &/*local_values*/, + OutputVector &/*values*/) const +{ + Assert (false, ExcNotImplemented()); +} + +template <> +template +void +DoFObjectAccessor<1,hp::DoFHandler<2> >::set_dof_values (const Vector &/*local_values*/, + OutputVector &/*values*/) const +{ + Assert (false, ExcNotImplemented()); +} + +template <> +template +void +DoFObjectAccessor<1,hp::DoFHandler<3> >::set_dof_values (const Vector &/*local_values*/, + OutputVector &/*values*/) const +{ + Assert (false, ExcNotImplemented()); +} + + + + +// --------------- hp::DoFHandler specializations for 2d objects ----------- + + +template <> +void DoFObjectAccessor<2, hp::DoFHandler<2> >::set_vertex_dof_index (const unsigned int /*vertex*/, + const unsigned int /*i*/, + const unsigned int /*index*/) const +{ + Assert (false, ExcInternalError()); +} + +template <> +void DoFObjectAccessor<2, hp::DoFHandler<3> >::set_vertex_dof_index (const unsigned int /*vertex*/, + const unsigned int /*i*/, + const unsigned int /*index*/) const +{ + Assert (false, ExcInternalError()); +} + + +template <> +template +void +DoFObjectAccessor<2,hp::DoFHandler<2> >::get_dof_values (const InputVector &/*values*/, + Vector &/*local_values*/) const +{ + Assert (false, ExcNotImplemented()); +} + +template <> +template +void +DoFObjectAccessor<2,hp::DoFHandler<3> >::get_dof_values (const InputVector &/*values*/, + Vector &/*local_values*/) const +{ + Assert (false, ExcNotImplemented()); +} + + +template <> +template +void +DoFObjectAccessor<2,hp::DoFHandler<2> >::set_dof_values (const Vector &/*local_values*/, + OutputVector &/*values*/) const +{ + Assert (false, ExcNotImplemented()); +} + +template <> +template +void +DoFObjectAccessor<2,hp::DoFHandler<3> >::set_dof_values (const Vector &/*local_values*/, + OutputVector &/*values*/) const +{ + Assert (false, ExcNotImplemented()); +} + + + + +// --------------- hp::DoFHandler specializations for 3d objects ----------- + + +template <> +void DoFObjectAccessor<3, hp::DoFHandler<3> >::set_vertex_dof_index (const unsigned int /*vertex*/, + const unsigned int /*i*/, + const unsigned int /*index*/) const +{ + Assert (false, ExcInternalError()); +} + +template <> +template +void +DoFObjectAccessor<3,hp::DoFHandler<3> >::get_dof_values (const InputVector &/*values*/, + Vector &/*local_values*/) const +{ + Assert (false, ExcNotImplemented()); +} + +template <> +template +void +DoFObjectAccessor<3,hp::DoFHandler<3> >::set_dof_values (const Vector &/*local_values*/, + OutputVector &/*values*/) const +{ + Assert (false, ExcNotImplemented()); +} + + + /*------------------------- Functions: DoFCellAccessor -----------------------*/ @@ -785,8 +967,8 @@ get_interpolated_dof_values (const InputVector &values, else if (tmp2(i) != 0) interpolated_values(i) = tmp2(i); - }; - }; + } + } } @@ -827,8 +1009,8 @@ set_dof_values_by_interpolation (const Vector &local_values, this->get_fe().get_prolongation_matrix(child) .vmult (tmp, local_values); this->child(child)->set_dof_values_by_interpolation (tmp, values); - }; - }; + } + } } -- 2.39.5