From 0ab07edb2a5828742e1a0ef15e466dcd39ba1be0 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sun, 23 Aug 2015 21:36:48 -0500 Subject: [PATCH] Move a bunch of internal functions into anonymous namespaces. Like the MappingQ1 class, MappingFEField had a bunch of internal functions that might as well live inside the .cc file only in an anonymous namespace. Do so. --- include/deal.II/fe/mapping_fe_field.h | 23 --- source/fe/mapping_fe_field.cc | 198 +++++++++++++------------- 2 files changed, 100 insertions(+), 121 deletions(-) diff --git a/include/deal.II/fe/mapping_fe_field.h b/include/deal.II/fe/mapping_fe_field.h index cbbc552f54..85cbfe41fb 100644 --- a/include/deal.II/fe/mapping_fe_field.h +++ b/include/deal.II/fe/mapping_fe_field.h @@ -445,29 +445,6 @@ private: * @} */ - /** - * This function and the next allow to generate the transform require by the - * virtual transform() in mapping, but unfortunately in C++ one cannot - * declare a virtual template function. - */ - template - void - transform_fields(const VectorSlice > > input, - VectorSlice > > output, - const typename Mapping::InternalDataBase &internal, - const MappingType mapping_type) const; - - - /** - * See transform_fields() above. - */ - template - void - transform_differential_forms(const VectorSlice > > input, - VectorSlice > > output, - const typename Mapping::InternalDataBase &mapping_data, - const MappingType mapping_type) const; - /** * Reference to the vector of shifts. diff --git a/source/fe/mapping_fe_field.cc b/source/fe/mapping_fe_field.cc index 2c267e8f36..e2b99103bb 100644 --- a/source/fe/mapping_fe_field.cc +++ b/source/fe/mapping_fe_field.cc @@ -980,6 +980,104 @@ fill_fe_subface_values (const typename Triangulation::cell_iterato } +namespace +{ + template + void + transform_fields(const VectorSlice > > input, + VectorSlice > > output, + const typename Mapping::InternalDataBase &mapping_data, + const MappingType mapping_type) + { + AssertDimension (input.size(), output.size()); + Assert ((dynamic_cast::InternalData *>(&mapping_data) != 0), + ExcInternalError()); + const typename MappingFEField::InternalData + &data = static_cast::InternalData &>(mapping_data); + + switch (mapping_type) + { + case mapping_contravariant: + { + Assert (data.update_each & update_contravariant_transformation, + typename FEValuesBase::ExcAccessToUninitializedField("update_contravariant_transformation")); + + for (unsigned int i=0; i::ExcAccessToUninitializedField("update_contravariant_transformation")); + Assert (data.update_each & update_volume_elements, + typename FEValuesBase::ExcAccessToUninitializedField("update_volume_elements")); + Assert (rank==1, ExcMessage("Only for rank 1")); + for (unsigned int i=0; i::ExcAccessToUninitializedField("update_contravariant_transformation")); + + for (unsigned int i=0; i + void + transform_differential_forms(const VectorSlice > > input, + VectorSlice > > output, + const typename Mapping::InternalDataBase &mapping_data, + const MappingType mapping_type) + { + + AssertDimension (input.size(), output.size()); + Assert ((dynamic_cast::InternalData *>(&mapping_data) != 0), + ExcInternalError()); + const typename MappingFEField::InternalData + &data = static_cast::InternalData &>(mapping_data); + + switch (mapping_type) + { + case mapping_covariant: + { + Assert (data.update_each & update_contravariant_transformation, + typename FEValuesBase::ExcAccessToUninitializedField("update_contravariant_transformation")); + + for (unsigned int i=0; i void @@ -991,7 +1089,7 @@ MappingFEField::transform ( { AssertDimension (input.size(), output.size()); - transform_fields(input, output, mapping_data, mapping_type); + transform_fields(input, output, mapping_data, mapping_type); } @@ -1006,7 +1104,7 @@ MappingFEField::transform ( { AssertDimension (input.size(), output.size()); - transform_differential_forms(input, output, mapping_data, mapping_type); + transform_differential_forms(input, output, mapping_data, mapping_type); } @@ -1092,102 +1190,6 @@ void MappingFEField::transform ( } -template -template < int rank > -void MappingFEField::transform_fields( - const VectorSlice > > input, - VectorSlice > > output, - const typename Mapping::InternalDataBase &mapping_data, - const MappingType mapping_type) const -{ - AssertDimension (input.size(), output.size()); - Assert (dynamic_cast(&mapping_data) != 0, - ExcInternalError()); - const InternalData &data = static_cast(mapping_data); - - switch (mapping_type) - { - case mapping_contravariant: - { - Assert (data.update_each & update_contravariant_transformation, - typename FEValuesBase::ExcAccessToUninitializedField("update_contravariant_transformation")); - - for (unsigned int i=0; i::ExcAccessToUninitializedField("update_contravariant_transformation")); - Assert (data.update_each & update_volume_elements, - typename FEValuesBase::ExcAccessToUninitializedField("update_volume_elements")); - Assert (rank==1, ExcMessage("Only for rank 1")); - for (unsigned int i=0; i::ExcAccessToUninitializedField("update_contravariant_transformation")); - - for (unsigned int i=0; i -template < int rank > -void MappingFEField::transform_differential_forms( - const VectorSlice > > input, - VectorSlice > > output, - const typename Mapping::InternalDataBase &mapping_data, - const MappingType mapping_type) const -{ - - AssertDimension (input.size(), output.size()); - Assert (dynamic_cast(&mapping_data) != 0, - ExcInternalError()); - const InternalData &data = static_cast(mapping_data); - - switch (mapping_type) - { - case mapping_covariant: - { - Assert (data.update_each & update_contravariant_transformation, - typename FEValuesBase::ExcAccessToUninitializedField("update_contravariant_transformation")); - - for (unsigned int i=0; i Point MappingFEField:: -- 2.39.5