From: kanschat Date: Mon, 5 Jan 2009 22:04:45 +0000 (+0000) Subject: finite elements use new transform functions now X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee6ac4055d21cb571c7d59a5c4f3248825a01108;p=dealii-svn.git finite elements use new transform functions now git-svn-id: https://svn.dealii.org/trunk@18087 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/fe/fe_poly.templates.h b/deal.II/deal.II/include/fe/fe_poly.templates.h index 1b6e3dd802..b579d00b4e 100644 --- a/deal.II/deal.II/include/fe/fe_poly.templates.h +++ b/deal.II/deal.II/include/fe/fe_poly.templates.h @@ -264,9 +264,9 @@ FE_Poly,1,2>::fill_fe_values (const Mapping<1,2> &ma Assert (data.shape_gradients[k].size() <= fe_data.shape_gradients[k].size(), ExcInternalError()); - mapping.transform_covariant(fe_data.shape_gradients[k], 0, - data.shape_gradients[k], - mapping_data); + mapping.transform(fe_data.shape_gradients[k], + data.shape_gradients[k], + mapping_data, mapping_covariant); } } @@ -307,9 +307,9 @@ FE_Poly,2,3>::fill_fe_values (const Mapping<2,3> &ma Assert (data.shape_gradients[k].size() <= fe_data.shape_gradients[k].size(), ExcInternalError()); - mapping.transform_covariant(fe_data.shape_gradients[k], 0, - data.shape_gradients[k], - mapping_data); + mapping.transform(fe_data.shape_gradients[k], + data.shape_gradients[k], + mapping_data, mapping_covariant); } } @@ -350,19 +350,18 @@ FE_Poly,1,2>::fill_fe_values (const Mapping<1,2> &/* mapping for (unsigned int i=0; i::DataSetDescriptor dsd; + // const typename QProjector<1>::DataSetDescriptor dsd; if (flags & update_hessians) { AssertThrow(false, ExcNotImplemented()); @@ -400,9 +399,9 @@ FE_Poly,2,3>::fill_fe_values (const Mapping<2,3> &/* mapping /* Assert (data.shape_gradients[k].size() */ /* fe_data.shape_gradients[k].size(), */ /* ExcInternalError()); */ -/* mapping.transform_covariant(fe_data.shape_gradients[k], 0, */ +/* mapping.transform(fe_data.shape_gradients[k], 0, */ /* data.shape_gradients[k], */ -/* mapping_data); */ +/* mapping_data, mapping_covariant); */ } } @@ -443,14 +442,8 @@ FE_Poly::fill_fe_values (const Mapping data.shape_values(k,i) = fe_data.shape_values[k][i]; if (flags & update_gradients) - { - Assert (data.shape_gradients[k].size() <= - fe_data.shape_gradients[k].size(), - ExcInternalError()); - mapping.transform_covariant(fe_data.shape_gradients[k], 0, - data.shape_gradients[k], - mapping_data); - } + mapping.transform(fe_data.shape_gradients[k], data.shape_gradients[k], + mapping_data, mapping_covariant); } const typename QProjector::DataSetDescriptor dsd; @@ -561,14 +554,9 @@ FE_Poly::fill_fe_face_values (const Mapping data.shape_values(k,i) = fe_data.shape_values[k][i+offset]; if (flags & update_gradients) - { - Assert (data.shape_gradients[k].size() + offset <= - fe_data.shape_gradients[k].size(), - ExcInternalError()); - mapping.transform_covariant(make_slice(fe_data.shape_gradients[k], offset, quadrature.size()), - 0, data.shape_gradients[k], - mapping_data); - } + mapping.transform(make_slice(fe_data.shape_gradients[k], offset, quadrature.size()), + data.shape_gradients[k], + mapping_data, mapping_covariant); } if (flags & update_hessians) @@ -686,9 +674,9 @@ FE_Poly::fill_fe_subface_values (const Mapping Assert (data.shape_gradients[k].size() + offset <= fe_data.shape_gradients[k].size(), ExcInternalError()); - mapping.transform_covariant(make_slice(fe_data.shape_gradients[k], offset, quadrature.size()), - 0, data.shape_gradients[k], - mapping_data); + mapping.transform(make_slice(fe_data.shape_gradients[k], offset, quadrature.size()), + data.shape_gradients[k], + mapping_data, mapping_covariant); } } diff --git a/deal.II/deal.II/include/fe/mapping.h b/deal.II/deal.II/include/fe/mapping.h index ebb7da2c1a..95779156ee 100644 --- a/deal.II/deal.II/include/fe/mapping.h +++ b/deal.II/deal.II/include/fe/mapping.h @@ -50,6 +50,14 @@ template class FESubfaceValues; * the transform() functions of * inheriting classes in order to * work. + * + * Mappings are usually defined + * for vectors. If such a + * MappingType is applied to a + * rank 2 tensor, it is implied + * that the resulting Tensor + * corresponds to the derivative + * of the vector. */ enum MappingType { diff --git a/deal.II/deal.II/source/fe/fe.cc b/deal.II/deal.II/source/fe/fe.cc index 0e17e536db..3a44e0290a 100644 --- a/deal.II/deal.II/source/fe/fe.cc +++ b/deal.II/deal.II/source/fe/fe.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by the deal.II authors +// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -1119,8 +1119,8 @@ FiniteElement::compute_2nd ( Assert (diff_quot2.size() <= diff_quot[d].size(), ExcInternalError()); - mapping.transform_covariant (diff_quot[d], 0, diff_quot2, - mapping_internal); + mapping.transform (diff_quot[d], diff_quot2, + mapping_internal, mapping_covariant); for (unsigned int q=0; q::fill_fe_values (const Mapping // values... Assert (fe_data.shape_values[k].size() == n_q_points, ExcInternalError()); - mapping.transform_covariant(fe_data.shape_values[k], 0, - shape_values, - mapping_data); + mapping.transform(fe_data.shape_values[k], shape_values, + mapping_data, mapping_covariant); // then copy over to target: for (unsigned int q=0; q::fill_fe_values (const Mapping Assert (fe_data.shape_gradients[k].size() == n_q_points, ExcInternalError()); // do first transformation - mapping.transform_covariant(fe_data.shape_gradients[k], 0, - shape_grads1, - mapping_data); + mapping.transform(fe_data.shape_gradients[k], shape_grads1, + mapping_data, mapping_covariant); // transpose matrix for (unsigned int q=0; q::fill_fe_face_values (const Mapping { // first transform shape // values... - mapping.transform_covariant(make_slice(fe_data.shape_values[k], offset, n_q_points), - 0, - shape_values, - mapping_data); + mapping.transform(make_slice(fe_data.shape_values[k], offset, n_q_points), + shape_values, mapping_data, mapping_covariant); // then copy over to target: for (unsigned int q=0; q::fill_fe_face_values (const Mapping // little in between // // do first transformation - mapping.transform_covariant(make_slice(fe_data.shape_gradients[k], offset, n_q_points), - 0, shape_grads1, - mapping_data); + mapping.transform(make_slice(fe_data.shape_gradients[k], offset, n_q_points), + shape_grads1, mapping_data, mapping_covariant); // transpose matrix for (unsigned int q=0; q::fill_fe_subface_values (const Mapping { // first transform shape // values... - mapping.transform_covariant(make_slice(fe_data.shape_values[k], offset, n_q_points), - 0, shape_values, - mapping_data); + mapping.transform(make_slice(fe_data.shape_values[k], offset, n_q_points), + shape_values, mapping_data, mapping_covariant); // then copy over to target: for (unsigned int q=0; q::fill_fe_subface_values (const Mapping // little in between // // do first transformation - mapping.transform_covariant(make_slice(fe_data.shape_gradients[k], offset, n_q_points), - 0, shape_grads1, - mapping_data); + mapping.transform(make_slice(fe_data.shape_gradients[k], offset, n_q_points), + shape_grads1, mapping_data, mapping_covariant); // transpose matrix for (unsigned int q=0; q::fill_fe_values ( // transformation std::vector > shape_values (n_q_points); if (mapping_type == covariant) - mapping.transform_covariant(fe_data.shape_values[i], 0, - shape_values, mapping_data); + mapping.transform(fe_data.shape_values[i], + shape_values, mapping_data, mapping_covariant); else - mapping.transform_contravariant(fe_data.shape_values[i], 0, - shape_values, mapping_data); + mapping.transform(fe_data.shape_values[i], + shape_values, mapping_data, mapping_contravariant); // then copy over to target: for (unsigned int k=0; k::fill_fe_values ( case independent: case independent_on_cartesian: { - mapping.transform_covariant(fe_data.shape_grads[i], 0, - shape_grads1, - mapping_data); + mapping.transform(fe_data.shape_grads[i], shape_grads1, + mapping_data, mapping_covariant); for (unsigned int k=0; k::fill_fe_values ( case covariant: { - mapping.transform_covariant(fe_data.shape_grads[i], 0, - shape_grads1, - mapping_data); + mapping.transform(fe_data.shape_grads[i], shape_grads1, + mapping_data, mapping_covariant); for (unsigned int q=0; q::fill_fe_values ( case contravariant: { - mapping.transform_covariant(fe_data.shape_grads[i], 0, - shape_grads1, - mapping_data); - - mapping.transform_contravariant(shape_grads1, 0, - shape_grads2, - mapping_data); + mapping.transform(fe_data.shape_grads[i], shape_grads1, + mapping_data, mapping_covariant); + + mapping.transform(shape_grads1, shape_grads2, + mapping_data, mapping_contravariant); for (unsigned int k=0; k::fill_fe_face_values ( // for transformation std::vector > shape_values (n_q_points); if (mapping_type == covariant) - mapping.transform_covariant(make_slice(fe_data.shape_values[i], offset, n_q_points), - 0, shape_values, mapping_data); + mapping.transform(make_slice(fe_data.shape_values[i], offset, n_q_points), + shape_values, mapping_data, mapping_covariant); else - mapping.transform_contravariant(make_slice(fe_data.shape_values[i], offset, n_q_points), - 0, shape_values, mapping_data); + mapping.transform(make_slice(fe_data.shape_values[i], offset, n_q_points), + shape_values, mapping_data, mapping_contravariant); // then copy over to target: for (unsigned int k=0; k::fill_fe_face_values ( case independent: case independent_on_cartesian: { - mapping.transform_covariant(make_slice(fe_data.shape_grads[i], offset, n_q_points), - 0, shape_grads1, mapping_data); + mapping.transform(make_slice(fe_data.shape_grads[i], offset, n_q_points), + shape_grads1, mapping_data, mapping_covariant); for (unsigned int k=0; k::fill_fe_face_values ( case covariant: { - mapping.transform_covariant(make_slice(fe_data.shape_grads[i], offset, n_q_points), - 0, shape_grads1, mapping_data); + mapping.transform(make_slice(fe_data.shape_grads[i], offset, n_q_points), + shape_grads1, mapping_data, mapping_covariant); for (unsigned int q=0; q::fill_fe_face_values ( case contravariant: { - mapping.transform_covariant(make_slice(fe_data.shape_grads[i], offset, n_q_points), - 0, shape_grads1, - mapping_data); + mapping.transform(make_slice(fe_data.shape_grads[i], offset, n_q_points), + shape_grads1, mapping_data, mapping_covariant); - mapping.transform_contravariant(shape_grads1, 0, - shape_grads2, - mapping_data); + mapping.transform(shape_grads1, shape_grads2, + mapping_data, mapping_contravariant); for (unsigned int k=0; k::fill_fe_subface_values ( // transformation std::vector > shape_values (n_q_points); if (mapping_type == covariant) - mapping.transform_covariant(make_slice(fe_data.shape_values[i], offset, n_q_points), - 0, shape_values, mapping_data); + mapping.transform(make_slice(fe_data.shape_values[i], offset, n_q_points), + shape_values, mapping_data, mapping_covariant); else - mapping.transform_contravariant(make_slice(fe_data.shape_values[i], offset, n_q_points), - 0, shape_values, mapping_data); + mapping.transform(make_slice(fe_data.shape_values[i], offset, n_q_points), + shape_values, mapping_data, mapping_contravariant); // then copy over to target: for (unsigned int k=0; k::fill_fe_subface_values ( case independent: case independent_on_cartesian: { - mapping.transform_covariant(make_slice(fe_data.shape_grads[i], offset, n_q_points), - 0, shape_grads1, mapping_data); + mapping.transform(make_slice(fe_data.shape_grads[i], offset, n_q_points), + shape_grads1, mapping_data, mapping_covariant); for (unsigned int k=0; k::fill_fe_subface_values ( case covariant: { - mapping.transform_covariant(make_slice(fe_data.shape_grads[i], offset, n_q_points), - 0, shape_grads1, - mapping_data); + mapping.transform(make_slice(fe_data.shape_grads[i], offset, n_q_points), + shape_grads1, mapping_data, mapping_covariant); for (unsigned int q=0; q::fill_fe_subface_values ( case contravariant: { - mapping.transform_covariant(make_slice(fe_data.shape_grads[i], offset, n_q_points), - 0, shape_grads1, - mapping_data); + mapping.transform(make_slice(fe_data.shape_grads[i], offset, n_q_points), + shape_grads1, mapping_data, mapping_covariant); - mapping.transform_contravariant(shape_grads1, 0, - shape_grads2, - mapping_data); + mapping.transform(shape_grads1, shape_grads2, + mapping_data, mapping_contravariant); for (unsigned int k=0; k::compute_fill_face (const typename Triangulation >::iterator result = boundary_forms.begin(); @@ -928,10 +924,8 @@ MappingQ1::compute_fill_face (const typename Triangulation::faces_per_cell].size(), ExcInternalError()); - transform_contravariant(data.unit_tangentials[ - face_no+GeometryInfo::faces_per_cell], 0, - data.aux[1], - data); + transform(data.unit_tangentials[face_no+GeometryInfo::faces_per_cell], + data.aux[1], data, mapping_contravariant); for (unsigned int i=0; result != end; ++result, ++i) cross_product (*result, data.aux[0][i], data.aux[1][i]); @@ -1240,6 +1234,7 @@ MappingQ1::transform ( } +// This function is deprecated and has been replaced by transform above template void MappingQ1::transform_covariant ( @@ -1271,6 +1266,7 @@ MappingQ1::transform_covariant ( +// This function is deprecated and has been replaced by transform above template void MappingQ1::transform_covariant ( @@ -1297,6 +1293,8 @@ MappingQ1::transform_covariant ( #if deal_II_dimension == 1 + +// This function is deprecated and has been replaced by transform above template <> void MappingQ1<1, 2>::transform_covariant ( @@ -1312,6 +1310,8 @@ MappingQ1<1, 2>::transform_covariant ( #if deal_II_dimension == 2 + +// This function is deprecated and has been replaced by transform above template <> void MappingQ1<2, 3>::transform_covariant ( @@ -1326,10 +1326,10 @@ MappingQ1<2, 3>::transform_covariant ( #endif +// This function is deprecated and has been replaced by transform above template void -MappingQ1:: -transform_contravariant ( +MappingQ1::transform_contravariant ( const VectorSlice > > input, const unsigned int offset, VectorSlice > > output, @@ -1357,6 +1357,7 @@ transform_contravariant ( +// This function is deprecated and has been replaced by transform above template void MappingQ1::transform_contravariant ( @@ -1382,6 +1383,7 @@ MappingQ1::transform_contravariant ( #if deal_II_dimension == 1 +// This function is deprecated and has been replaced by transform above template <> void MappingQ1<1, 2>::transform_contravariant ( @@ -1397,6 +1399,7 @@ MappingQ1<1, 2>::transform_contravariant ( #if deal_II_dimension == 2 +// This function is deprecated and has been replaced by transform above template <> void MappingQ1<2, 3>::transform_contravariant (