From: Daniel Arndt Date: Wed, 20 Jun 2018 16:12:07 +0000 (+0200) Subject: Define FE_NedelecSZ with a spacedim argument. X-Git-Tag: v9.1.0-rc1~1009^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F6809%2Fhead;p=dealii.git Define FE_NedelecSZ with a spacedim argument. --- diff --git a/include/deal.II/fe/fe_nedelec_sz.h b/include/deal.II/fe/fe_nedelec_sz.h index ab86e24fb5..ba5dfbbe1d 100644 --- a/include/deal.II/fe/fe_nedelec_sz.h +++ b/include/deal.II/fe/fe_nedelec_sz.h @@ -67,10 +67,13 @@ DEAL_II_NAMESPACE_OPEN * @author Ross Kynch * @date 2016, 2017, 2018 */ -template +template class FE_NedelecSZ : public FiniteElement { public: + static_assert(dim == spacedim, + "FE_NedelecSZ is only implemented for dim==spacedim!"); + /** * Constructor for an element of given @p degree. */ @@ -153,12 +156,14 @@ protected: */ MappingType mapping_type; - virtual std::unique_ptr::InternalDataBase> + virtual std::unique_ptr< + typename dealii::FiniteElement::InternalDataBase> get_data( - const UpdateFlags update_flags, - const Mapping &mapping, - const Quadrature & quadrature, - dealii::internal::FEValuesImplementation::FiniteElementRelatedData + const UpdateFlags update_flags, + const Mapping &mapping, + const Quadrature & quadrature, + dealii::internal::FEValuesImplementation::FiniteElementRelatedData &output_data) const override; /** diff --git a/source/fe/fe_nedelec_sz.cc b/source/fe/fe_nedelec_sz.cc index a43cc3aeca..a6ede02562 100644 --- a/source/fe/fe_nedelec_sz.cc +++ b/source/fe/fe_nedelec_sz.cc @@ -20,8 +20,8 @@ DEAL_II_NAMESPACE_OPEN // Constructor: -template -FE_NedelecSZ::FE_NedelecSZ(const unsigned int degree) +template +FE_NedelecSZ::FE_NedelecSZ(const unsigned int degree) : FiniteElement( FiniteElementData(get_dpo_vector(degree), dim, @@ -47,10 +47,10 @@ FE_NedelecSZ::FE_NedelecSZ(const unsigned int degree) } // Shape functions: -template +template double -FE_NedelecSZ::shape_value(const unsigned int /*i*/, - const Point & /*p*/) const +FE_NedelecSZ::shape_value(const unsigned int /*i*/, + const Point & /*p*/) const { typedef FiniteElement FEE; Assert(false, typename FEE::ExcFENotPrimitive()); @@ -59,11 +59,12 @@ FE_NedelecSZ::shape_value(const unsigned int /*i*/, -template +template double -FE_NedelecSZ::shape_value_component(const unsigned int /*i*/, - const Point & /*p*/, - const unsigned int /*component*/) const +FE_NedelecSZ::shape_value_component( + const unsigned int /*i*/, + const Point & /*p*/, + const unsigned int /*component*/) const { // Not implemented yet: Assert(false, ExcNotImplemented()); @@ -72,10 +73,10 @@ FE_NedelecSZ::shape_value_component(const unsigned int /*i*/, -template +template Tensor<1, dim> -FE_NedelecSZ::shape_grad(const unsigned int /*i*/, - const Point & /*p*/) const +FE_NedelecSZ::shape_grad(const unsigned int /*i*/, + const Point & /*p*/) const { typedef FiniteElement FEE; Assert(false, typename FEE::ExcFENotPrimitive()); @@ -84,11 +85,12 @@ FE_NedelecSZ::shape_grad(const unsigned int /*i*/, -template +template Tensor<1, dim> -FE_NedelecSZ::shape_grad_component(const unsigned int /*i*/, - const Point & /*p*/, - const unsigned int /*component*/) const +FE_NedelecSZ::shape_grad_component( + const unsigned int /*i*/, + const Point & /*p*/, + const unsigned int /*component*/) const { Assert(false, ExcNotImplemented()); return Tensor<1, dim>(); @@ -96,10 +98,10 @@ FE_NedelecSZ::shape_grad_component(const unsigned int /*i*/, -template +template Tensor<2, dim> -FE_NedelecSZ::shape_grad_grad(const unsigned int /*i*/, - const Point & /*p*/) const +FE_NedelecSZ::shape_grad_grad(const unsigned int /*i*/, + const Point & /*p*/) const { typedef FiniteElement FEE; Assert(false, typename FEE::ExcFENotPrimitive()); @@ -108,9 +110,9 @@ FE_NedelecSZ::shape_grad_grad(const unsigned int /*i*/, -template +template Tensor<2, dim> -FE_NedelecSZ::shape_grad_grad_component( +FE_NedelecSZ::shape_grad_grad_component( const unsigned int /*i*/, const Point & /*p*/, const unsigned int /*component*/) const @@ -120,17 +122,17 @@ FE_NedelecSZ::shape_grad_grad_component( } - -template -std::unique_ptr::InternalDataBase> -FE_NedelecSZ::get_data( +template +std::unique_ptr::InternalDataBase> +FE_NedelecSZ::get_data( const UpdateFlags update_flags, - const Mapping & /*mapping*/, + const Mapping & /*mapping*/, const Quadrature &quadrature, - dealii::internal::FEValuesImplementation::FiniteElementRelatedData + dealii::internal::FEValuesImplementation::FiniteElementRelatedData & /*output_data*/) const { - std::unique_ptr data(new InternalData); + auto data = std_cxx14::make_unique(); data->update_each = update_each(update_flags) | update_once(update_flags); // Useful quantities: @@ -1095,9 +1097,9 @@ FE_NedelecSZ::get_data( return std::move(data); } -template +template void -FE_NedelecSZ::fill_edge_values( +FE_NedelecSZ::fill_edge_values( const typename Triangulation::cell_iterator &cell, const Quadrature & quadrature, const InternalData & fe_data) const @@ -1520,9 +1522,9 @@ FE_NedelecSZ::fill_edge_values( } } -template +template void -FE_NedelecSZ::fill_face_values( +FE_NedelecSZ::fill_face_values( const typename Triangulation::cell_iterator &cell, const Quadrature & quadrature, const InternalData & fe_data) const @@ -1894,9 +1896,9 @@ FE_NedelecSZ::fill_face_values( } } -template +template void -FE_NedelecSZ::fill_fe_values( +FE_NedelecSZ::fill_fe_values( const typename Triangulation::cell_iterator &cell, const CellSimilarity::Similarity /*cell_similarity*/, const Quadrature & quadrature, @@ -2006,9 +2008,9 @@ FE_NedelecSZ::fill_fe_values( } } -template +template void -FE_NedelecSZ::fill_fe_face_values( +FE_NedelecSZ::fill_fe_face_values( const typename Triangulation::cell_iterator &cell, const unsigned int face_no, const Quadrature & quadrature, @@ -2132,9 +2134,9 @@ FE_NedelecSZ::fill_fe_face_values( } } -template +template void -FE_NedelecSZ::fill_fe_subface_values( +FE_NedelecSZ::fill_fe_subface_values( const typename Triangulation::cell_iterator & /*cell*/, const unsigned int /*face_no*/, const unsigned int /*sub_no*/, @@ -2150,16 +2152,17 @@ FE_NedelecSZ::fill_fe_subface_values( Assert(false, ExcNotImplemented()); } -template +template UpdateFlags -FE_NedelecSZ::requires_update_flags(const UpdateFlags flags) const +FE_NedelecSZ::requires_update_flags( + const UpdateFlags flags) const { return update_once(flags) | update_each(flags); } -template +template UpdateFlags -FE_NedelecSZ::update_once(const UpdateFlags flags) const +FE_NedelecSZ::update_once(const UpdateFlags flags) const { const bool values_once = (mapping_type == mapping_none); @@ -2170,9 +2173,9 @@ FE_NedelecSZ::update_once(const UpdateFlags flags) const return out; } -template +template UpdateFlags -FE_NedelecSZ::update_each(const UpdateFlags flags) const +FE_NedelecSZ::update_each(const UpdateFlags flags) const { UpdateFlags out = update_default; @@ -2194,9 +2197,9 @@ FE_NedelecSZ::update_each(const UpdateFlags flags) const return out; } -template +template std::string -FE_NedelecSZ::get_name() const +FE_NedelecSZ::get_name() const { // note that the // FETools::get_fe_from_name @@ -2211,16 +2214,16 @@ FE_NedelecSZ::get_name() const return namebuf.str(); } -template +template std::unique_ptr> -FE_NedelecSZ::clone() const +FE_NedelecSZ::clone() const { - return std_cxx14::make_unique>(*this); + return std_cxx14::make_unique>(*this); } -template +template std::vector -FE_NedelecSZ::get_dpo_vector(const unsigned int degree) +FE_NedelecSZ::get_dpo_vector(const unsigned int degree) { // internal function to return a vector of "dofs per object" // where the objects inside the vector refer to: @@ -2239,9 +2242,9 @@ FE_NedelecSZ::get_dpo_vector(const unsigned int degree) return dpo; } -template +template unsigned int -FE_NedelecSZ::compute_num_dofs(const unsigned int degree) const +FE_NedelecSZ::compute_num_dofs(const unsigned int degree) const { // Internal function to compute the number of DoFs // for a given dimension & polynomial order. @@ -2261,9 +2264,9 @@ FE_NedelecSZ::compute_num_dofs(const unsigned int degree) const } } -template +template void -FE_NedelecSZ::create_polynomials(const unsigned int degree) +FE_NedelecSZ::create_polynomials(const unsigned int degree) { // fill the 1d polynomials vector: IntegratedLegendrePolynomials =