// side with only one parameter,
// namely the point where we want to
// evaluate the function.
+ //
+ // Note that the C++ language forces
+ // us to declare and define a
+ // constructor to the following
+ // classes even though they are
+ // empty. This is due to the fact
+ // that the base class has no default
+ // constructor (i.e. one without
+ // arguments), even though it has a
+ // constructor which has default
+ // values for all arguments.
template <int dim>
class RightHandSide : public Function<dim>
{
public:
+ RightHandSide () : Function<dim>() {};
+
virtual double value (const Point<dim> &p,
const unsigned int component = 0) const;
};
class BoundaryValues : public Function<dim>
{
public:
+ BoundaryValues () : Function<dim>() {};
+
virtual double value (const Point<dim> &p,
const unsigned int component = 0) const;
};
// information from the ``value''
// function as well will be explained
// below when assembling the matrix.
+ //
+ // The need to declare a seemingly
+ // useless default constructor exists
+ // here just as in the previous
+ // example.
template <int dim>
class Coefficient : public Function<dim>
{
public:
+ Coefficient () : Function<dim>() {};
+
virtual double value (const Point<dim> &p,
const unsigned int component = 0) const;
class Coefficient : public Function<dim>
{
public:
+ Coefficient () : Function<dim>() {};
+
virtual double value (const Point<dim> &p,
const unsigned int component = 0) const;
// respective virtual member
// functions in the ``Function'' base
// class.
+ //
+ // Just as in previous examples, we
+ // are forced by the C++ language
+ // specification to declare a
+ // seemingly useless default
+ // constructor.
template <int dim>
class Solution : public Function<dim>,
protected SolutionBase<dim>
{
public:
+ Solution () : Function<dim>() {};
+
virtual double value (const Point<dim> &p,
const unsigned int component = 0) const;
virtual Tensor<1,dim> gradient (const Point<dim> &p,