18#ifndef SOLUTION_FUNCTION_H
19#define SOLUTION_FUNCTION_H
22#include "libmesh/function_base.h"
25#include "div_grad_exact_solution.h"
32template<
unsigned int dim>
42 { libmesh_not_implemented(); }
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);
85template<
unsigned int dim>
91 (*this)(p, 0, outvec);
92 return outvec(component_in);
95template<
unsigned int dim>
104 { libmesh_not_implemented(); }
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);
147template<
unsigned int dim>
153 (*this)(p, 0, outvec);
154 return outvec(component_in);
virtual Number component(unsigned int component_in, const Point &p, const Real)
virtual Number operator()(const Point &, const Real=0)
virtual std::unique_ptr< FunctionBase< Number > > clone() const
DivGradExactSolution soln
virtual Number component(unsigned int component_in, const Point &p, const Real)
SolutionFunction()=default
~SolutionFunction()=default
~SolutionGradient()=default
SolutionGradient()=default
DivGradExactSolution soln
virtual Gradient component(unsigned int component_in, const Point &p, const Real)
virtual Gradient operator()(const Point &, const Real=0)
virtual std::unique_ptr< FunctionBase< Gradient > > clone() const
virtual Gradient component(unsigned int component_in, const Point &p, const Real)
Defines a dense vector for use in Finite Element-type computations.
virtual void zero() override final
Set every element in the vector to 0.
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.
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.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real