From 51c340dcf998ad127e884c608611919735cf4055 Mon Sep 17 00:00:00 2001 From: hartmann Date: Thu, 12 Oct 2000 11:55:41 +0000 Subject: [PATCH] New transform_unit_to_real_cell function in FiniteElement git-svn-id: https://svn.dealii.org/trunk@3428 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/fe/fe.h | 11 ++++++++++- deal.II/deal.II/include/fe/fe_system.h | 16 ++++++++++++++++ deal.II/deal.II/include/fe/q1_mapping.h | 9 +++++++++ deal.II/deal.II/source/fe/fe_system.cc | 12 ++++++++++++ deal.II/deal.II/source/fe/q1_mapping.cc | 12 ++++++++++++ 5 files changed, 59 insertions(+), 1 deletion(-) diff --git a/deal.II/deal.II/include/fe/fe.h b/deal.II/deal.II/include/fe/fe.h index 438c4c6350..b3d0fc17c0 100644 --- a/deal.II/deal.II/include/fe/fe.h +++ b/deal.II/deal.II/include/fe/fe.h @@ -194,7 +194,7 @@ class FiniteElementData unsigned int n_components () const; /** - * Return the @p{transform_functions}. + * Return the value of @p{transform_functions}. */ unsigned int n_transform_functions () const; @@ -1077,6 +1077,15 @@ class FiniteElement : public FiniteElementBase virtual Tensor<2,dim> shape_grad_grad (const unsigned int i, const Point &p) const = 0; + /** + * Transforms the point @p{p} on + * the unit cell to the point + * @p{p_real} on the real cell + * @p{cell} and returns @p{p_real}. + */ + virtual Point transform_unit_to_real_cell (const DoFHandler::cell_iterator cell, + const Point &p) const = 0; + /** * Return the value of the * @p{i}th shape function of the diff --git a/deal.II/deal.II/include/fe/fe_system.h b/deal.II/deal.II/include/fe/fe_system.h index 4b9d753ed4..9ee12608c7 100644 --- a/deal.II/deal.II/include/fe/fe_system.h +++ b/deal.II/deal.II/include/fe/fe_system.h @@ -251,6 +251,22 @@ class FESystem : public FiniteElement virtual void get_local_mass_matrix (const DoFHandler::cell_iterator &cell, FullMatrix &local_mass_matrix) const; + /** + * Transforms the point @p{p} on + * the unit cell to the point + * @p{p_real} on the real cell + * @p{cell} and returns + * @p{p_real}. As the + * transformation mapping of each + * @p{FiniteElement} of this + * @p{FESystem} should be the + * same, this function just calls + * the @p{transform} function of + * @p{base_element(0)}. + */ + virtual Point transform_unit_to_real_cell (const DoFHandler::cell_iterator cell, + const Point &p) const; + /** * Return the value of the @p{i}th shape * function of the transformation mapping diff --git a/deal.II/deal.II/include/fe/q1_mapping.h b/deal.II/deal.II/include/fe/q1_mapping.h index 3a554a15ee..ee47fc6e63 100644 --- a/deal.II/deal.II/include/fe/q1_mapping.h +++ b/deal.II/deal.II/include/fe/q1_mapping.h @@ -47,6 +47,15 @@ class FEQ1Mapping : public FiniteElement const unsigned int n_components, const vector &restriction_is_additive_flags); + /** + * Transforms the point @p{p} on + * the unit cell to the point + * @p{p_real} on the real cell + * @p{cell} and returns @p{p_real}. + */ + virtual Point transform_unit_to_real_cell (const DoFHandler::cell_iterator cell, + const Point &p) const; + /** * Return the value of the @p{i}th shape * function at point @p{p} on the unit cell. diff --git a/deal.II/deal.II/source/fe/fe_system.cc b/deal.II/deal.II/source/fe/fe_system.cc index 6a2c7fbfb9..883a6d7dfe 100644 --- a/deal.II/deal.II/source/fe/fe_system.cc +++ b/deal.II/deal.II/source/fe/fe_system.cc @@ -13,6 +13,9 @@ #include +#include +#include + template @@ -921,6 +924,15 @@ void FESystem::get_local_mass_matrix (const DoFHandler::cell_iterator }; +template +Point FESystem::transform_unit_to_real_cell ( + const DoFHandler::cell_iterator cell, + const Point &p) const +{ + return base_elements[0].first->transform_unit_to_real_cell(cell, p); +}; + + template double FESystem::shape_value_transform (const unsigned int i, const Point &p) const diff --git a/deal.II/deal.II/source/fe/q1_mapping.cc b/deal.II/deal.II/source/fe/q1_mapping.cc index 7ce933a7a9..3633c5c784 100644 --- a/deal.II/deal.II/source/fe/q1_mapping.cc +++ b/deal.II/deal.II/source/fe/q1_mapping.cc @@ -531,6 +531,18 @@ void FEQ1Mapping<3>::get_normal_vectors (const DoFHandler<3>::cell_iterator &/*c #endif +template +Point FEQ1Mapping::transform_unit_to_real_cell ( + const DoFHandler::cell_iterator cell, + const Point &p) const +{ + Point p_real; + for (unsigned int i=0; i::vertices_per_cell; ++i) + p_real+=cell->vertex(i) * shape_value_transform (i, p); + return p_real; +} + + template void FEQ1Mapping::fill_fe_values (const DoFHandler::cell_iterator &cell, const vector > &unit_points, -- 2.39.5