From 9368e91c35aa025f47e6fcb946528ebcab9f4c8b Mon Sep 17 00:00:00 2001 From: David Wells Date: Sun, 17 Jul 2016 14:15:26 -0400 Subject: [PATCH] Use a plain function, not a Function, in step-6. --- examples/step-6/step-6.cc | 77 +++++++++------------------------------ 1 file changed, 17 insertions(+), 60 deletions(-) diff --git a/examples/step-6/step-6.cc b/examples/step-6/step-6.cc index 2699df2e5f..6fca75be28 100644 --- a/examples/step-6/step-6.cc +++ b/examples/step-6/step-6.cc @@ -131,26 +131,8 @@ private: // The implementation of nonconstant coefficients is copied verbatim from // step-5: - template -class Coefficient : public Function -{ -public: - Coefficient () : Function() {} - - virtual double value (const Point &p, - const unsigned int component = 0) const; - - virtual void value_list (const std::vector > &points, - std::vector &values, - const unsigned int component = 0) const; -}; - - - -template -double Coefficient::value (const Point &p, - const unsigned int) const +double coefficient (const Point &p) { if (p.square() < 0.5*0.5) return 20; @@ -160,29 +142,6 @@ double Coefficient::value (const Point &p, -template -void Coefficient::value_list (const std::vector > &points, - std::vector &values, - const unsigned int component) const -{ - const unsigned int n_points = points.size(); - - Assert (values.size() == n_points, - ExcDimensionMismatch (values.size(), n_points)); - - Assert (component == 0, - ExcIndexRange (component, 0, 1)); - - for (unsigned int i=0; iStep6 class implementation} // @sect4{Step6::Step6} @@ -407,9 +366,6 @@ void Step6::assemble_system () std::vector local_dof_indices (dofs_per_cell); - const Coefficient coefficient; - std::vector coefficient_values (n_q_points); - typename DoFHandler::active_cell_iterator cell = dof_handler.begin_active(), endc = dof_handler.end(); @@ -420,22 +376,23 @@ void Step6::assemble_system () fe_values.reinit (cell); - coefficient.value_list (fe_values.get_quadrature_points(), - coefficient_values); - for (unsigned int q_index=0; q_index + (fe_values.quadrature_point (q_index)); + for (unsigned int i=0; i