From 9a4ad72c512891ab2d97b1f8e0074bc8e9620b3c Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Thu, 21 May 2020 12:31:37 -0400 Subject: [PATCH] Avoid unnecessary casts --- source/fe/fe_dgp_monomial.cc | 5 +---- source/fe/fe_dgq.cc | 7 ++----- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/source/fe/fe_dgp_monomial.cc b/source/fe/fe_dgp_monomial.cc index f505bb986f..61477873f3 100644 --- a/source/fe/fe_dgp_monomial.cc +++ b/source/fe/fe_dgp_monomial.cc @@ -233,13 +233,10 @@ FE_DGPMonomial::get_interpolation_matrix( source_fe_matrix(k, j) = source_fe.shape_value(j, unit_points[k]); FullMatrix this_matrix(this->dofs_per_cell, this->dofs_per_cell); - auto *const polynomial_space_p = - dynamic_cast *>(this->poly_space.get()); - Assert(polynomial_space_p != nullptr, ExcInternalError()); for (unsigned int j = 0; j < this->dofs_per_cell; ++j) for (unsigned int k = 0; k < unit_points.size(); ++k) this_matrix(k, j) = - polynomial_space_p->compute_value(j, unit_points[k]); + this->poly_space->compute_value(j, unit_points[k]); this_matrix.gauss_jordan(); diff --git a/source/fe/fe_dgq.cc b/source/fe/fe_dgq.cc index ad26b3049d..85670d6e0e 100644 --- a/source/fe/fe_dgq.cc +++ b/source/fe/fe_dgq.cc @@ -303,14 +303,11 @@ FE_DGQ::get_interpolation_matrix( // cell and evaluate the // shape functions there const Point p = this->unit_support_points[j]; - auto *const polynomial_space_p = - dynamic_cast *>(this->poly_space.get()); - Assert(polynomial_space_p != nullptr, ExcInternalError()); for (unsigned int i = 0; i < this->dofs_per_cell; ++i) - cell_interpolation(j, i) = polynomial_space_p->compute_value(i, p); + cell_interpolation(j, i) = this->poly_space->compute_value(i, p); for (unsigned int i = 0; i < source_fe.dofs_per_cell; ++i) - source_interpolation(j, i) = polynomial_space_p->compute_value(i, p); + source_interpolation(j, i) = source_fe.poly_space->compute_value(i, p); } // then compute the -- 2.39.5