]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Remove RightHandSide
authorDaniel Arndt <arndtd@ornl.gov>
Sat, 11 May 2019 15:38:04 +0000 (11:38 -0400)
committerDaniel Arndt <arndtd@ornl.gov>
Sat, 11 May 2019 15:38:59 +0000 (11:38 -0400)
examples/step-46/step-46.cc

index 5b88cabebbb95d268e74234548d1e45de6b176fc..2e45fc9cde33be692430c81f5bd34383e3a314ec 100644 (file)
@@ -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 <int dim>
   class StokesBoundaryValues : public Function<dim>
   {
@@ -204,40 +204,6 @@ namespace Step46
 
 
 
-  template <int dim>
-  class RightHandSide : public Function<dim>
-  {
-  public:
-    RightHandSide()
-      : Function<dim>(dim + 1)
-    {}
-
-    virtual double value(const Point<dim> & p,
-                         const unsigned int component = 0) const override;
-
-    virtual void vector_value(const Point<dim> &p,
-                              Vector<double> &  value) const override;
-  };
-
-
-  template <int dim>
-  double RightHandSide<dim>::value(const Point<dim> & /*p*/,
-                                   const unsigned int /*component*/) const
-  {
-    return 0;
-  }
-
-
-  template <int dim>
-  void RightHandSide<dim>::vector_value(const Point<dim> &p,
-                                        Vector<double> &  values) const
-  {
-    for (unsigned int c = 0; c < this->n_components; ++c)
-      values(c) = RightHandSide<dim>::value(p, c);
-  }
-
-
-
   // @sect3{The <code>FluidStructureProblem</code> implementation}
 
   // @sect4{Constructors and helper functions}
@@ -556,7 +522,7 @@ namespace Step46
     std::vector<types::global_dof_index> neighbor_dof_indices(
       stokes_dofs_per_cell);
 
-    const RightHandSide<dim> right_hand_side;
+    const Functions::ZeroFunction<dim> 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

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.