From 2ac1c348b83f342f4eb59057ddd003f1d1f0620f Mon Sep 17 00:00:00 2001 From: bangerth Date: Sat, 20 Nov 2010 00:06:45 +0000 Subject: [PATCH] Simplify code slightly. git-svn-id: https://svn.dealii.org/trunk@22827 0785d39b-7218-0410-832d-ea1e28bc413d --- .../include/deal.II/fe/fe_poly.templates.h | 157 +++++++++--------- 1 file changed, 75 insertions(+), 82 deletions(-) diff --git a/deal.II/include/deal.II/fe/fe_poly.templates.h b/deal.II/include/deal.II/fe/fe_poly.templates.h index 93e95f5071..f7642932dc 100644 --- a/deal.II/include/deal.II/fe/fe_poly.templates.h +++ b/deal.II/include/deal.II/fe/fe_poly.templates.h @@ -145,7 +145,7 @@ FE_Poly::update_each (const UpdateFlags flags) const out |= update_hessians | update_covariant_transformation; if (flags & update_cell_normal_vectors) out |= update_cell_normal_vectors | update_JxW_values; - + return out; } @@ -217,11 +217,11 @@ FE_Poly::get_data (const UpdateFlags update_flags, { poly_space.compute(quadrature.point(i), values, grads, grad_grads); - + if (flags & update_values) for (unsigned int k=0; kdofs_per_cell; ++k) data->shape_values[k][i] = values[k]; - + if (flags & update_gradients) for (unsigned int k=0; kdofs_per_cell; ++k) data->shape_gradients[k][i] = grads[k]; @@ -240,7 +240,7 @@ FE_Poly::get_data (const UpdateFlags update_flags, template <> inline void -FE_Poly,1,2>::fill_fe_values +FE_Poly,1,2>::fill_fe_values (const Mapping<1,2> &mapping, const Triangulation<1,2>::cell_iterator &/*cell*/, const Quadrature<1> &quadrature, @@ -255,25 +255,24 @@ FE_Poly,1,2>::fill_fe_values // possible Assert (dynamic_cast (&fedata) != 0, ExcInternalError()); InternalData &fe_data = static_cast (fedata); - + const UpdateFlags flags(fe_data.current_update_flags()); - + for (unsigned int k=0; kdofs_per_cell; ++k) { if (flags & update_values) for (unsigned int i=0; i::DataSetDescriptor dsd; + if (flags & update_hessians && cell_similarity != CellSimilarity::translation) { AssertThrow(false, ExcNotImplemented()); -/* this->compute_2nd (mapping, cell, dsd.cell(), */ +/* this->compute_2nd (mapping, cell, QProjector::DataSetDescriptor::cell(), */ /* mapping_data, fe_data, data); */ } } @@ -283,7 +282,7 @@ FE_Poly,1,2>::fill_fe_values template <> inline void -FE_Poly,2,3>::fill_fe_values +FE_Poly,2,3>::fill_fe_values (const Mapping<2,3> &mapping, const Triangulation<2,3>::cell_iterator &/* cell */, const Quadrature<2> &quadrature, @@ -297,25 +296,24 @@ FE_Poly,2,3>::fill_fe_values // cast is really well-defined. Assert (dynamic_cast (&fedata) != 0, ExcInternalError()); InternalData &fe_data = static_cast (fedata); - + const UpdateFlags flags(fe_data.current_update_flags()); - + for (unsigned int k=0; kdofs_per_cell; ++k) { if (flags & update_values) for (unsigned int i=0; i::DataSetDescriptor dsd; */ + if (flags & update_hessians && cell_similarity != CellSimilarity::translation) { AssertThrow(false, ExcNotImplemented()); -/* this->compute_2nd (mapping, cell, dsd.cell(), */ +/* this->compute_2nd (mapping, cell, QProjector::DataSetDescriptor::cell(), */ /* mapping_data, fe_data, data); */ } @@ -338,30 +336,29 @@ FE_Poly,1,2>::fill_fe_values ( // data for this class. fails with // an exception if that is not // possible - + Assert (dynamic_cast (&fedata) != 0, ExcInternalError()); InternalData &fe_data = static_cast (fedata); - + const UpdateFlags flags(fe_data.current_update_flags()); - + for (unsigned int k=0; kdofs_per_cell; ++k) { if (flags & update_values) for (unsigned int i=0; i::DataSetDescriptor dsd; + if (flags & update_hessians && cell_similarity != CellSimilarity::translation) { AssertThrow(false, ExcNotImplemented()); -/* this->compute_2nd (mapping, cell, dsd.cell(), */ +/* this->compute_2nd (mapping, cell, QProjector::DataSetDescriptor::cell(), */ /* mapping_data, fe_data, data); */ } } @@ -370,7 +367,7 @@ FE_Poly,1,2>::fill_fe_values ( template <> inline void -FE_Poly,2,3>::fill_fe_values +FE_Poly,2,3>::fill_fe_values (const Mapping<2,3> &mapping, const Triangulation<2,3>::cell_iterator &/* cell */, const Quadrature<2> &quadrature, @@ -381,26 +378,25 @@ FE_Poly,2,3>::fill_fe_values { Assert (dynamic_cast (&fedata) != 0, ExcInternalError()); InternalData &fe_data = static_cast (fedata); - + const UpdateFlags flags(fe_data.current_update_flags()); - + for (unsigned int k=0; kdofs_per_cell; ++k) { if (flags & update_values) for (unsigned int i=0; i::DataSetDescriptor dsd; */ + if (flags & update_hessians && cell_similarity != CellSimilarity::translation) { AssertThrow(false, ExcNotImplemented()); -/* this->compute_2nd (mapping, cell, dsd.cell(), */ +/* this->compute_2nd (mapping, cell, QProjector::DataSetDescriptor::cell(), */ /* mapping_data, fe_data, data); */ } @@ -409,7 +405,7 @@ FE_Poly,2,3>::fill_fe_values template void -FE_Poly::fill_fe_values +FE_Poly::fill_fe_values (const Mapping &mapping, const typename Triangulation::cell_iterator &cell, const Quadrature &quadrature, @@ -421,26 +417,25 @@ FE_Poly::fill_fe_values // convert data object to internal // data for this class. fails with // an exception if that is not - // possible + // possible Assert (dynamic_cast (&fedata) != 0, ExcInternalError()); InternalData &fe_data = static_cast (fedata); - + const UpdateFlags flags(fe_data.current_update_flags()); - + for (unsigned int k=0; kdofs_per_cell; ++k) { if (flags & update_values) for (unsigned int i=0; i::DataSetDescriptor dsd; + if (flags & update_hessians && cell_similarity != CellSimilarity::translation) - this->compute_2nd (mapping, cell, dsd.cell(), + this->compute_2nd (mapping, cell, QProjector::DataSetDescriptor::cell(), mapping_data, fe_data, data); } @@ -449,33 +444,33 @@ FE_Poly::fill_fe_values template <> inline void -FE_Poly,1,2>::fill_fe_face_values +FE_Poly,1,2>::fill_fe_face_values (const Mapping<1,2> &, const Triangulation<1,2>::cell_iterator &, const unsigned int, - const Quadrature<0> &, + const Quadrature<0> &, Mapping<1,2>::InternalDataBase &, Mapping<1,2>::InternalDataBase &, FEValuesData<1,2> &) const { AssertThrow(false, ExcNotImplemented()); -} +} + - template <> inline void FE_Poly,2,3>::fill_fe_face_values (const Mapping<2,3> &, const Triangulation<2,3>::cell_iterator &, const unsigned int, - const Quadrature<1> &, + const Quadrature<1> &, Mapping<2,3>::InternalDataBase &, Mapping<2,3>::InternalDataBase &, FEValuesData<2,3> &) const { AssertThrow(false, ExcNotImplemented()); -} +} @@ -485,29 +480,29 @@ void FE_Poly,1,2>::fill_fe_face_values (const Mapping<1,2> &, const Triangulation<1,2>::cell_iterator &, const unsigned int, - const Quadrature<0> &, + const Quadrature<0> &, Mapping<1,2>::InternalDataBase &, Mapping<1,2>::InternalDataBase &, FEValuesData<1,2> &) const { AssertThrow(false, ExcNotImplemented()); -} +} + - template <> inline void FE_Poly,2,3>::fill_fe_face_values (const Mapping<2,3> &, const Triangulation<2,3>::cell_iterator &, const unsigned int, - const Quadrature<1> &, + const Quadrature<1> &, Mapping<2,3>::InternalDataBase &, Mapping<2,3>::InternalDataBase &, FEValuesData<2,3> &) const { AssertThrow(false, ExcNotImplemented()); -} +} template @@ -531,15 +526,14 @@ fill_fe_face_values (const Mapping &mapping, // offset determines which data set // to take (all data sets for all // faces are stored contiguously) - - const typename QProjector::DataSetDescriptor dsd; + const typename QProjector::DataSetDescriptor offset - = dsd.face (face, - cell->face_orientation(face), - cell->face_flip(face), - cell->face_rotation(face), - quadrature.size()); - + = QProjector::DataSetDescriptor::face (face, + cell->face_orientation(face), + cell->face_flip(face), + cell->face_rotation(face), + quadrature.size()); + const UpdateFlags flags(fe_data.update_once | fe_data.update_each); for (unsigned int k=0; kdofs_per_cell; ++k) @@ -547,7 +541,7 @@ fill_fe_face_values (const Mapping &mapping, if (flags & update_values) for (unsigned int i=0; i,1,2>::fill_fe_subface_values (const Mapping<1,2> &, const Triangulation<1,2>::cell_iterator &, const unsigned int, - const unsigned int, - const Quadrature<0> &, + const unsigned int, + const Quadrature<0> &, Mapping<1,2>::InternalDataBase &, Mapping<1,2>::InternalDataBase &, FEValuesData<1,2> &) const { AssertThrow(false, ExcNotImplemented()); -} +} template <> @@ -582,14 +576,14 @@ void FE_Poly,2,3>::fill_fe_subface_values (const Mapping<2,3> &, const Triangulation<2,3>::cell_iterator &, const unsigned int, - const unsigned int, - const Quadrature<1> &, + const unsigned int, + const Quadrature<1> &, Mapping<2,3>::InternalDataBase &, Mapping<2,3>::InternalDataBase &, FEValuesData<2,3> &) const { AssertThrow(false, ExcNotImplemented()); -} +} template <> @@ -598,14 +592,14 @@ void FE_Poly,1,2>::fill_fe_subface_values (const Mapping<1,2> &, const Triangulation<1,2>::cell_iterator &, const unsigned int, - const unsigned int, - const Quadrature<0> &, + const unsigned int, + const Quadrature<0> &, Mapping<1,2>::InternalDataBase &, Mapping<1,2>::InternalDataBase &, FEValuesData<1,2> &) const { AssertThrow(false, ExcNotImplemented()); -} +} template <> @@ -614,14 +608,14 @@ void FE_Poly,2,3>::fill_fe_subface_values (const Mapping<2,3> &, const Triangulation<2,3>::cell_iterator &, const unsigned int, - const unsigned int, - const Quadrature<1> &, + const unsigned int, + const Quadrature<1> &, Mapping<2,3>::InternalDataBase &, Mapping<2,3>::InternalDataBase &, FEValuesData<2,3> &) const { AssertThrow(false, ExcNotImplemented()); -} +} @@ -648,14 +642,13 @@ FE_Poly::fill_fe_subface_values (const Mapping // to take (all data sets for all // sub-faces are stored contiguously) - const typename QProjector::DataSetDescriptor dsd; const typename QProjector::DataSetDescriptor offset - = dsd.subface (face, subface, - cell->face_orientation(face), - cell->face_flip(face), - cell->face_rotation(face), - quadrature.size(), - cell->subface_case(face)); + = QProjector::DataSetDescriptor::subface (face, subface, + cell->face_orientation(face), + cell->face_flip(face), + cell->face_rotation(face), + quadrature.size(), + cell->subface_case(face)); const UpdateFlags flags(fe_data.update_once | fe_data.update_each); @@ -664,13 +657,13 @@ FE_Poly::fill_fe_subface_values (const Mapping if (flags & update_values) for (unsigned int i=0; icompute_2nd (mapping, cell, offset, mapping_data, fe_data, data); } -- 2.39.5