From 9c67f7f59b30c1d8b217cfde63fb59336d669d0b Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Tue, 20 Dec 2005 05:23:30 +0000 Subject: [PATCH] Make a few functions inline to avoid linker errors. The functions are small enough to do so anyway. git-svn-id: https://svn.dealii.org/trunk@11891 0785d39b-7218-0410-832d-ea1e28bc413d --- .../include/dofs/dof_accessor.templates.h | 158 ++++++++++++++++++ .../deal.II/source/dofs/hp_dof_accessor.cc | 142 ---------------- 2 files changed, 158 insertions(+), 142 deletions(-) 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 22e75dd93c..ed06a2af09 100644 --- a/deal.II/deal.II/include/dofs/dof_accessor.templates.h +++ b/deal.II/deal.II/include/dofs/dof_accessor.templates.h @@ -1169,6 +1169,85 @@ DoFObjectAccessor<1,3,hpDoFHandler>::dof_index (const unsigned int i) const } + +template <> +inline +void +DoFObjectAccessor<1, 1, hpDoFHandler>::set_dof_index (const unsigned int i, + const unsigned int index) const +{ + typedef DoFAccessor<1, hpDoFHandler> BaseClass; + + Assert (this->dof_handler != 0, + BaseClass::ExcInvalidObject()); + // make sure a FE has been selected + // and enough room was reserved + Assert (&this->get_fe() != 0, + BaseClass::ExcInvalidObject()); + Assert (iget_fe().dofs_per_line, + ExcIndexRange (i, 0, this->get_fe().dofs_per_line)); + + const unsigned int offset = this->dof_handler->levels[this->present_level] + ->dof_line_index_offset[this->present_index]; + this->dof_handler->levels[this->present_level] + ->line_dofs[offset+i] = index; +} + + +template <> +inline +void +DoFObjectAccessor<1, 2, hpDoFHandler>::set_dof_index (const unsigned int i, + const unsigned int index) const +{ + typedef DoFAccessor<2, hpDoFHandler> BaseClass; + + Assert (this->dof_handler != 0, + BaseClass::ExcInvalidObject()); + // make sure a FE has been selected + // and enough room was reserved + Assert (&this->get_fe() != 0, + BaseClass::ExcInvalidObject()); + Assert (iget_fe().dofs_per_line, + ExcIndexRange (i, 0, this->get_fe().dofs_per_line)); + +//TODO:[?] In two dimension it could happen that we have different active_fe_indices +// on a line between to cells. Hence we have to differentiate between these two cases. +// Unfortunately, this requires more information then available now. + + const unsigned int offset = this->dof_handler->levels[this->present_level] + ->dof_line_index_offset[this->present_index]; + this->dof_handler->levels[this->present_level] + ->line_dofs[offset+i] = index; +} + + +template <> +inline +void +DoFObjectAccessor<1, 3, hpDoFHandler>::set_dof_index (const unsigned int i, + const unsigned int index) const +{ + typedef DoFAccessor<3, hpDoFHandler> BaseClass; + + Assert (this->dof_handler != 0, + BaseClass::ExcInvalidObject()); + // make sure a FE has been selected + // and enough room was reserved + Assert (&this->get_fe() != 0, + BaseClass::ExcInvalidObject()); + Assert (iget_fe().dofs_per_line, + ExcIndexRange (i, 0, this->get_fe().dofs_per_line)); + + const unsigned int offset = this->dof_handler->levels[this->present_level] + ->dof_line_index_offset[this->present_index]; + this->dof_handler->levels[this->present_level] + ->line_dofs[offset+i] = index; +} + + + + template <> inline const FiniteElement<1> & @@ -1322,6 +1401,55 @@ unsigned int DoFObjectAccessor<2,3,hpDoFHandler>::dof_index (const unsigned int } +template <> +inline +void +DoFObjectAccessor<2, 2, hpDoFHandler>::set_dof_index (const unsigned int i, + const unsigned int index) const +{ + typedef DoFAccessor<2, hpDoFHandler> BaseClass; + + Assert (this->dof_handler != 0, + BaseClass::ExcInvalidObject()); + // make sure a FE has been selected + // and enough room was reserved + Assert (&this->get_fe() != 0, + BaseClass::ExcInvalidObject()); + Assert (iget_fe().dofs_per_quad, + ExcIndexRange (i, 0, this->get_fe().dofs_per_quad)); + + const unsigned int offset = this->dof_handler->levels[this->present_level] + ->dof_quad_index_offset[this->present_index]; + this->dof_handler->levels[this->present_level] + ->quad_dofs[offset+i] = index; +} + + +template <> +inline +void +DoFObjectAccessor<2, 3, hpDoFHandler>::set_dof_index (const unsigned int i, + const unsigned int index) const +{ + typedef DoFAccessor<3, hpDoFHandler> BaseClass; + + Assert (this->dof_handler != 0, + BaseClass::ExcInvalidObject()); + // make sure a FE has been selected + // and enough room was reserved + Assert (&this->get_fe() != 0, + BaseClass::ExcInvalidObject()); + Assert (iget_fe().dofs_per_quad, + ExcIndexRange (i, 0, this->get_fe().dofs_per_quad)); + + const unsigned int offset = this->dof_handler->levels[this->present_level] + ->dof_quad_index_offset[this->present_index]; + this->dof_handler->levels[this->present_level] + ->quad_dofs[offset+i] = index; +} + + + template <> inline const FiniteElement<2> & @@ -1329,6 +1457,9 @@ DoFObjectAccessor<2,2,hpDoFHandler>::get_fe () const { return dof_handler->finite_elements->get_fe(active_fe_index ()); } + + + template <> inline const FiniteElement<3> & @@ -1338,6 +1469,7 @@ DoFObjectAccessor<2,3,hpDoFHandler>::get_fe () const } + template <> inline unsigned int @@ -1427,6 +1559,31 @@ DoFObjectAccessor<3,3,hpDoFHandler>::dof_index (const unsigned int i) const } +template <> +inline +void +DoFObjectAccessor<3, 3, hpDoFHandler>::set_dof_index (const unsigned int i, + const unsigned int index) const +{ + typedef DoFAccessor<3, hpDoFHandler> BaseClass; + + Assert (this->dof_handler != 0, + BaseClass::ExcInvalidObject()); + // make sure a FE has been selected + // and enough room was reserved + Assert (&this->get_fe() != 0, + BaseClass::ExcInvalidObject()); + Assert (iget_fe().dofs_per_hex, + ExcIndexRange (i, 0, this->get_fe().dofs_per_hex)); + + const unsigned int offset = this->dof_handler->levels[this->present_level] + ->dof_hex_index_offset[this->present_index]; + this->dof_handler->levels[this->present_level] + ->hex_dofs[offset+i] = index; +} + + + template <> inline const FiniteElement<3> & @@ -1450,6 +1607,7 @@ DoFObjectAccessor<3,3,hpDoFHandler>::active_fe_index () const } + template <> inline void diff --git a/deal.II/deal.II/source/dofs/hp_dof_accessor.cc b/deal.II/deal.II/source/dofs/hp_dof_accessor.cc index 47052bfd77..1c63f8f06a 100644 --- a/deal.II/deal.II/source/dofs/hp_dof_accessor.cc +++ b/deal.II/deal.II/source/dofs/hp_dof_accessor.cc @@ -66,145 +66,3 @@ DoFCellAccessor<3,hpDoFHandler>::face (const unsigned int i) const #endif - -/*----------------- Functions: DoFObjectAccessor<1,dim,hpDoFHander> ----------*/ - -template <> -void DoFObjectAccessor<1, 1, hpDoFHandler>::set_dof_index (const unsigned int i, - const unsigned int index) const -{ - typedef DoFAccessor<1, hpDoFHandler> BaseClass; - - Assert (this->dof_handler != 0, - BaseClass::ExcInvalidObject()); - // make sure a FE has been selected - // and enough room was reserved - Assert (&this->get_fe() != 0, - BaseClass::ExcInvalidObject()); - Assert (iget_fe().dofs_per_line, - ExcIndexRange (i, 0, this->get_fe().dofs_per_line)); - - const unsigned int offset = this->dof_handler->levels[this->present_level] - ->dof_line_index_offset[this->present_index]; - this->dof_handler->levels[this->present_level] - ->line_dofs[offset+i] = index; -} - - -template <> -void DoFObjectAccessor<1, 2, hpDoFHandler>::set_dof_index (const unsigned int i, - const unsigned int index) const -{ - typedef DoFAccessor<2, hpDoFHandler> BaseClass; - - Assert (this->dof_handler != 0, - BaseClass::ExcInvalidObject()); - // make sure a FE has been selected - // and enough room was reserved - Assert (&this->get_fe() != 0, - BaseClass::ExcInvalidObject()); - Assert (iget_fe().dofs_per_line, - ExcIndexRange (i, 0, this->get_fe().dofs_per_line)); - -//TODO:[?] In two dimension it could happen that we have different active_fe_indices -// on a line between to cells. Hence we have to differentiate between these two cases. -// Unfortunately, this requires more information then available now. - - const unsigned int offset = this->dof_handler->levels[this->present_level] - ->dof_line_index_offset[this->present_index]; - this->dof_handler->levels[this->present_level] - ->line_dofs[offset+i] = index; -} - - -template <> -void DoFObjectAccessor<1, 3, hpDoFHandler>::set_dof_index (const unsigned int i, - const unsigned int index) const -{ - typedef DoFAccessor<3, hpDoFHandler> BaseClass; - - Assert (this->dof_handler != 0, - BaseClass::ExcInvalidObject()); - // make sure a FE has been selected - // and enough room was reserved - Assert (&this->get_fe() != 0, - BaseClass::ExcInvalidObject()); - Assert (iget_fe().dofs_per_line, - ExcIndexRange (i, 0, this->get_fe().dofs_per_line)); - - const unsigned int offset = this->dof_handler->levels[this->present_level] - ->dof_line_index_offset[this->present_index]; - this->dof_handler->levels[this->present_level] - ->line_dofs[offset+i] = index; -} - - - -/*----------------- Functions: DoFObjectAccessor<2,dim,hpDoFHander> ----------*/ - -template <> -void DoFObjectAccessor<2, 2, hpDoFHandler>::set_dof_index (const unsigned int i, - const unsigned int index) const -{ - typedef DoFAccessor<2, hpDoFHandler> BaseClass; - - Assert (this->dof_handler != 0, - BaseClass::ExcInvalidObject()); - // make sure a FE has been selected - // and enough room was reserved - Assert (&this->get_fe() != 0, - BaseClass::ExcInvalidObject()); - Assert (iget_fe().dofs_per_quad, - ExcIndexRange (i, 0, this->get_fe().dofs_per_quad)); - - const unsigned int offset = this->dof_handler->levels[this->present_level] - ->dof_quad_index_offset[this->present_index]; - this->dof_handler->levels[this->present_level] - ->quad_dofs[offset+i] = index; -} - - -template <> -void DoFObjectAccessor<2, 3, hpDoFHandler>::set_dof_index (const unsigned int i, - const unsigned int index) const -{ - typedef DoFAccessor<3, hpDoFHandler> BaseClass; - - Assert (this->dof_handler != 0, - BaseClass::ExcInvalidObject()); - // make sure a FE has been selected - // and enough room was reserved - Assert (&this->get_fe() != 0, - BaseClass::ExcInvalidObject()); - Assert (iget_fe().dofs_per_quad, - ExcIndexRange (i, 0, this->get_fe().dofs_per_quad)); - - const unsigned int offset = this->dof_handler->levels[this->present_level] - ->dof_quad_index_offset[this->present_index]; - this->dof_handler->levels[this->present_level] - ->quad_dofs[offset+i] = index; -} - - -/*----------------- Functions: DoFObjectAccessor<3,dim,hpDoFHander> ----------*/ - -template <> -void DoFObjectAccessor<3, 3, hpDoFHandler>::set_dof_index (const unsigned int i, - const unsigned int index) const -{ - typedef DoFAccessor<3, hpDoFHandler> BaseClass; - - Assert (this->dof_handler != 0, - BaseClass::ExcInvalidObject()); - // make sure a FE has been selected - // and enough room was reserved - Assert (&this->get_fe() != 0, - BaseClass::ExcInvalidObject()); - Assert (iget_fe().dofs_per_hex, - ExcIndexRange (i, 0, this->get_fe().dofs_per_hex)); - - const unsigned int offset = this->dof_handler->levels[this->present_level] - ->dof_hex_index_offset[this->present_index]; - this->dof_handler->levels[this->present_level] - ->hex_dofs[offset+i] = index; -} -- 2.39.5