From 9493f19fef568222cde706574fed622eb05e94db Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 6 Apr 2017 08:52:31 -0600 Subject: [PATCH] Implement FE::convert_generalized_support_point_values_to_nodal_values() for FE_Q_iso_Q1. --- include/deal.II/fe/fe_q_iso_q1.h | 14 +++++++++++++- source/fe/fe_q_iso_q1.cc | 24 ++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/include/deal.II/fe/fe_q_iso_q1.h b/include/deal.II/fe/fe_q_iso_q1.h index d163801c97..92bf7f5cb8 100644 --- a/include/deal.II/fe/fe_q_iso_q1.h +++ b/include/deal.II/fe/fe_q_iso_q1.h @@ -1,6 +1,6 @@ // --------------------------------------------------------------------- // -// Copyright (C) 2000 - 2016 by the deal.II authors +// Copyright (C) 2000 - 2017 by the deal.II authors // // This file is part of the deal.II library. // @@ -121,6 +121,18 @@ public: */ virtual std::string get_name () const; + /** + * Implementation of the corresponding function in the FiniteElement + * class. Since the current element is interpolatory, the nodal + * values are exactly the support point values. Furthermore, since + * the current element is scalar, the support point values need to + * be vectors of length 1. + */ + virtual + void + convert_generalized_support_point_values_to_nodal_values (const std::vector > &support_point_values, + std::vector &nodal_values) const; + /** * @name Functions to support hp * @{ diff --git a/source/fe/fe_q_iso_q1.cc b/source/fe/fe_q_iso_q1.cc index 6e362f6518..fdbf224aa5 100644 --- a/source/fe/fe_q_iso_q1.cc +++ b/source/fe/fe_q_iso_q1.cc @@ -15,6 +15,7 @@ #include +#include #include #include @@ -67,6 +68,29 @@ FE_Q_iso_Q1::get_name () const +template +void +FE_Q_iso_Q1:: +convert_generalized_support_point_values_to_nodal_values (const std::vector > &support_point_values, + std::vector &nodal_values) const +{ + AssertDimension (support_point_values.size(), + this->get_unit_support_points().size()); + AssertDimension (support_point_values.size(), + nodal_values.size()); + AssertDimension (this->dofs_per_cell, + nodal_values.size()); + + for (unsigned int i=0; idofs_per_cell; ++i) + { + AssertDimension (support_point_values[i].size(), 1); + + nodal_values[i] = support_point_values[i](0); + } +} + + + template FiniteElement * FE_Q_iso_Q1::clone() const -- 2.39.5