18 #ifndef SOLUTION_FUNCTION_H 19 #define SOLUTION_FUNCTION_H 22 #include "libmesh/function_base.h" 25 #include "div_grad_exact_solution.h" 32 template<
unsigned int dim>
42 { libmesh_not_implemented(); }
44 virtual void operator() (
const Point & p,
48 virtual Number component(
unsigned int component_in,
52 virtual std::unique_ptr<FunctionBase<Number>>
clone()
const 53 {
return std::make_unique<SolutionFunction>(); }
66 const Real x=p(0), y=p(1);
67 output(0) = soln(x, y)(0);
68 output(1) = soln(x, y)(1);
69 output(2) = soln.scalar(x, y);
78 const Real x=p(0), y=p(1), z=p(2);
79 output(0) = soln(x, y, z)(0);
80 output(1) = soln(x, y, z)(1);
81 output(2) = soln(x, y, z)(2);
82 output(3) = soln.scalar(x, y, z);
85 template<
unsigned int dim>
91 (*this)(p, 0, outvec);
92 return outvec(component_in);
95 template<
unsigned int dim>
104 { libmesh_not_implemented(); }
106 virtual void operator() (
const Point & p,
110 virtual Gradient component(
unsigned int component_in,
114 virtual std::unique_ptr<FunctionBase<Gradient>>
clone()
const 115 {
return std::make_unique<SolutionGradient>(); }
128 const Real x=p(0), y=p(1);
129 output(0) = soln.grad(x, y).row(0);
130 output(1) = soln.grad(x, y).row(1);
131 output(2) = -soln(x, y);
140 const Real x=p(0), y=p(1), z=p(2);
141 output(0) = soln.grad(x, y, z).row(0);
142 output(1) = soln.grad(x, y, z).row(1);
143 output(2) = soln.grad(x, y, z).row(2);
144 output(3) = -soln(x, y, z);
147 template<
unsigned int dim>
153 (*this)(p, 0, outvec);
154 return outvec(component_in);
157 #endif // SOLUTION_FUNCTION_H virtual Number component(unsigned int component_in, const Point &p, const Real)
virtual std::unique_ptr< FunctionBase< Gradient > > clone() const
virtual Number operator()(const Point &, const Real=0)
virtual void zero() override final
Set every element in the vector to 0.
virtual Gradient operator()(const Point &, const Real=0)
virtual std::unique_ptr< FunctionBase< Number > > clone() const
virtual Gradient component(unsigned int component_in, const Point &p, const Real)
This class defines a vector in LIBMESH_DIM dimensional Real or Complex space.
The libMesh namespace provides an interface to certain functionality in the library.
DivGradExactSolution soln
DivGradExactSolution soln
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Base class for functors that can be evaluated at a point and (optionally) time.
A Point defines a location in LIBMESH_DIM dimensional Real space.