From: Wolfgang Bangerth Date: Wed, 2 Sep 2015 18:26:44 +0000 (-0500) Subject: Provide MappingQ::transform() variants. X-Git-Tag: v8.4.0-rc2~486^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1512%2Fhead;p=dealii.git Provide MappingQ::transform() variants. Adding these variants had previously been forgotten. --- diff --git a/include/deal.II/fe/mapping_q.h b/include/deal.II/fe/mapping_q.h index 9577b13868..ec29075344 100644 --- a/include/deal.II/fe/mapping_q.h +++ b/include/deal.II/fe/mapping_q.h @@ -141,6 +141,22 @@ public: const typename Mapping::InternalDataBase &internal, VectorSlice > > output) const; + // for documentation, see the Mapping base class + virtual + void + transform (const VectorSlice > > input, + const MappingType type, + const typename Mapping::InternalDataBase &internal, + VectorSlice > > output) const; + + // for documentation, see the Mapping base class + virtual + void + transform (const VectorSlice > > input, + const MappingType type, + const typename Mapping::InternalDataBase &internal, + VectorSlice > > output) const; + /** * Return the degree of the mapping, i.e. the value which was passed to the * constructor. diff --git a/source/fe/mapping_q.cc b/source/fe/mapping_q.cc index 5c69092a75..4f811729ed 100644 --- a/source/fe/mapping_q.cc +++ b/source/fe/mapping_q.cc @@ -1086,6 +1086,68 @@ transform (const VectorSlice > > input, } + +template +void +MappingQ:: +transform (const VectorSlice > > input, + const MappingType mapping_type, + const typename Mapping::InternalDataBase &mapping_data, + VectorSlice > > output) const +{ + AssertDimension (input.size(), output.size()); + // The data object may be just a MappingQ1::InternalData, so we have to test + // for this first. + const typename MappingQ1::InternalData *q1_data = + dynamic_cast::InternalData *> (&mapping_data); + Assert(q1_data!=0, ExcInternalError()); + + // If it is a genuine MappingQ::InternalData, we have to test further + if (!q1_data->is_mapping_q1_data) + { + Assert (dynamic_cast(&mapping_data) != 0, + ExcInternalError()); + const InternalData &data = static_cast(mapping_data); + // If we only use the Q1-portion, we have to extract that data object + if (data.use_mapping_q1_on_current_cell) + q1_data = &data.mapping_q1_data; + } + // Now, q1_data should have the right tensors in it and we call the base + // classes transform function + MappingQ1::transform(input, mapping_type, *q1_data, output); +} + + +template +void MappingQ:: +transform (const VectorSlice > > input, + const MappingType mapping_type, + const typename Mapping::InternalDataBase &mapping_data, + VectorSlice > > output) const +{ + AssertDimension (input.size(), output.size()); + // The data object may be just a MappingQ1::InternalData, so we have to test + // for this first. + const typename MappingQ1::InternalData *q1_data = + dynamic_cast::InternalData *> (&mapping_data); + Assert(q1_data!=0, ExcInternalError()); + + // If it is a genuine MappingQ::InternalData, we have to test further + if (!q1_data->is_mapping_q1_data) + { + Assert (dynamic_cast(&mapping_data) != 0, + ExcInternalError()); + const InternalData &data = static_cast(mapping_data); + // If we only use the Q1-portion, we have to extract that data object + if (data.use_mapping_q1_on_current_cell) + q1_data = &data.mapping_q1_data; + } + // Now, q1_data should have the right tensors in it and we call the base + // classes transform function + MappingQ1::transform(input, mapping_type, *q1_data, output); +} + + template Point MappingQ::