From bb8b64dbf33cb13c12c7d0d52039dc12561f496f Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Sat, 11 May 2019 11:38:04 -0400 Subject: [PATCH] Remove RightHandSide --- examples/step-46/step-46.cc | 40 +++---------------------------------- 1 file changed, 3 insertions(+), 37 deletions(-) diff --git a/examples/step-46/step-46.cc b/examples/step-46/step-46.cc index 5b88cabebb..2e45fc9cde 100644 --- a/examples/step-46/step-46.cc +++ b/examples/step-46/step-46.cc @@ -150,12 +150,12 @@ namespace Step46 // @sect3{Boundary values and right hand side} - // The following classes do as their names suggest. The boundary values for + // The following class does as its names suggest. The boundary values for // the velocity are $\mathbf u=(0, \sin(\pi x))^T$ in 2d and $\mathbf u=(0, // 0, \sin(\pi x)\sin(\pi y))^T$ in 3d, respectively. The remaining boundary // conditions for this problem are all homogeneous and have been discussed in // the introduction. The right hand side forcing term is zero for both the - // fluid and the solid. + // fluid and the solid so we don't need an extra class for it. template class StokesBoundaryValues : public Function { @@ -204,40 +204,6 @@ namespace Step46 - template - class RightHandSide : public Function - { - public: - RightHandSide() - : Function(dim + 1) - {} - - virtual double value(const Point & p, - const unsigned int component = 0) const override; - - virtual void vector_value(const Point &p, - Vector & value) const override; - }; - - - template - double RightHandSide::value(const Point & /*p*/, - const unsigned int /*component*/) const - { - return 0; - } - - - template - void RightHandSide::vector_value(const Point &p, - Vector & values) const - { - for (unsigned int c = 0; c < this->n_components; ++c) - values(c) = RightHandSide::value(p, c); - } - - - // @sect3{The FluidStructureProblem implementation} // @sect4{Constructors and helper functions} @@ -556,7 +522,7 @@ namespace Step46 std::vector neighbor_dof_indices( stokes_dofs_per_cell); - const RightHandSide right_hand_side; + const Functions::ZeroFunction right_hand_side(dim + 1); // ...to variables that allow us to extract certain components of the // shape functions and cache their values rather than having to recompute -- 2.39.5