]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Avoid unnecessary casts
authorDaniel Arndt <arndtd@ornl.gov>
Thu, 21 May 2020 16:31:37 +0000 (12:31 -0400)
committerDaniel Arndt <arndtd@ornl.gov>
Thu, 21 May 2020 16:31:37 +0000 (12:31 -0400)
source/fe/fe_dgp_monomial.cc
source/fe/fe_dgq.cc

index f505bb986f5febd623689648d9c6f8ec8b79ab44..61477873f3f8a5012ebb369e5b7f5e7e6bcbff6d 100644 (file)
@@ -233,13 +233,10 @@ FE_DGPMonomial<dim>::get_interpolation_matrix(
           source_fe_matrix(k, j) = source_fe.shape_value(j, unit_points[k]);
 
       FullMatrix<double> this_matrix(this->dofs_per_cell, this->dofs_per_cell);
-      auto *const        polynomial_space_p =
-        dynamic_cast<PolynomialsP<dim> *>(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();
 
index ad26b3049daa0538ba3f2e1d1e4813f764ccdde5..85670d6e0e51520e57d23db55a0cbe0189ff335b 100644 (file)
@@ -303,14 +303,11 @@ FE_DGQ<dim, spacedim>::get_interpolation_matrix(
       // cell and evaluate the
       // shape functions there
       const Point<dim> p = this->unit_support_points[j];
-      auto *const      polynomial_space_p =
-        dynamic_cast<TensorProductPolynomials<dim> *>(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

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.