Tensor<order, dim>
compute_derivative(const unsigned int i, const Point<dim> &p) const;
+ /**
+ * @copydoc ScalarPolynomialsBase::compute_1st_derivative()
+ */
+ virtual Tensor<1, dim>
+ compute_1st_derivative(const unsigned int i,
+ const Point<dim> & p) const override;
+
+ /**
+ * @copydoc ScalarPolynomialsBase::compute_2nd_derivative()
+ */
+ virtual Tensor<2, dim>
+ compute_2nd_derivative(const unsigned int i,
+ const Point<dim> & p) const override;
+
+ /**
+ * @copydoc ScalarPolynomialsBase::compute_3rd_derivative()
+ */
+ virtual Tensor<3, dim>
+ compute_3rd_derivative(const unsigned int i,
+ const Point<dim> & p) const override;
+
+ /**
+ * @copydoc ScalarPolynomialsBase::compute_4th_derivative()
+ */
+ virtual Tensor<4, dim>
+ compute_4th_derivative(const unsigned int i,
+ const Point<dim> & p) const override;
+
/**
* Compute the gradient of the <tt>i</tt>th polynomial at unit point
* <tt>p</tt>.
}
+
+template <int dim>
+inline Tensor<1, dim>
+PolynomialSpace<dim>::compute_1st_derivative(const unsigned int i,
+ const Point<dim> & p) const
+{
+ return compute_derivative<1>(i, p);
+}
+
+
+
+template <int dim>
+inline Tensor<2, dim>
+PolynomialSpace<dim>::compute_2nd_derivative(const unsigned int i,
+ const Point<dim> & p) const
+{
+ return compute_derivative<2>(i, p);
+}
+
+
+
+template <int dim>
+inline Tensor<3, dim>
+PolynomialSpace<dim>::compute_3rd_derivative(const unsigned int i,
+ const Point<dim> & p) const
+{
+ return compute_derivative<3>(i, p);
+}
+
+
+
+template <int dim>
+inline Tensor<4, dim>
+PolynomialSpace<dim>::compute_4th_derivative(const unsigned int i,
+ const Point<dim> & p) const
+{
+ return compute_derivative<4>(i, p);
+}
+
DEAL_II_NAMESPACE_CLOSE
#endif
double
compute_value(const unsigned int i, const Point<dim> &p) const override;
+ /**
+ * @copydoc ScalarPolynomialsBase::compute_1st_derivative()
+ */
+ virtual Tensor<1, dim>
+ compute_1st_derivative(const unsigned int i,
+ const Point<dim> & p) const override;
+
+ /**
+ * @copydoc ScalarPolynomialsBase::compute_2nd_derivative()
+ */
+ virtual Tensor<2, dim>
+ compute_2nd_derivative(const unsigned int i,
+ const Point<dim> & p) const override;
+
+ /**
+ * @copydoc ScalarPolynomialsBase::compute_3rd_derivative()
+ */
+ virtual Tensor<3, dim>
+ compute_3rd_derivative(const unsigned int i,
+ const Point<dim> & p) const override;
+
+ /**
+ * @copydoc ScalarPolynomialsBase::compute_4th_derivative()
+ */
+ virtual Tensor<4, dim>
+ compute_4th_derivative(const unsigned int i,
+ const Point<dim> & p) const override;
+
/**
* Compute the gradient of the <tt>i</tt>th polynomial at
* <tt>unit_point</tt>.
+template <int dim>
+inline Tensor<1, dim>
+PolynomialsAdini<dim>::compute_1st_derivative(const unsigned int /*i*/,
+ const Point<dim> & /*p*/) const
+{
+ Assert(false, ExcNotImplemented());
+ return {};
+}
+
+
+
+template <int dim>
+inline Tensor<2, dim>
+PolynomialsAdini<dim>::compute_2nd_derivative(const unsigned int /*i*/,
+ const Point<dim> & /*p*/) const
+{
+ Assert(false, ExcNotImplemented());
+ return {};
+}
+
+
+
+template <int dim>
+inline Tensor<3, dim>
+PolynomialsAdini<dim>::compute_3rd_derivative(const unsigned int /*i*/,
+ const Point<dim> & /*p*/) const
+{
+ Assert(false, ExcNotImplemented());
+ return {};
+}
+
+
+
+template <int dim>
+inline Tensor<4, dim>
+PolynomialsAdini<dim>::compute_4th_derivative(const unsigned int /*i*/,
+ const Point<dim> & /*p*/) const
+{
+ Assert(false, ExcNotImplemented());
+ return {};
+}
+
+
+
template <int dim>
inline std::string
PolynomialsAdini<dim>::name() const
Tensor<order, dim>
compute_derivative(const unsigned int i, const Point<dim> &p) const;
+ /**
+ * @copydoc ScalarPolynomialsBase::compute_1st_derivative()
+ */
+ virtual Tensor<1, dim>
+ compute_1st_derivative(const unsigned int i,
+ const Point<dim> & p) const override;
+
+ /**
+ * @copydoc ScalarPolynomialsBase::compute_2nd_derivative()
+ */
+ virtual Tensor<2, dim>
+ compute_2nd_derivative(const unsigned int i,
+ const Point<dim> & p) const override;
+
+ /**
+ * @copydoc ScalarPolynomialsBase::compute_3rd_derivative()
+ */
+ virtual Tensor<3, dim>
+ compute_3rd_derivative(const unsigned int i,
+ const Point<dim> & p) const override;
+
+ /**
+ * @copydoc ScalarPolynomialsBase::compute_4th_derivative()
+ */
+ virtual Tensor<4, dim>
+ compute_4th_derivative(const unsigned int i,
+ const Point<dim> & p) const override;
+
/**
* Gradient of basis function @p i at @p p.
*/
+template <int dim>
+inline Tensor<1, dim>
+PolynomialsRannacherTurek<dim>::compute_1st_derivative(
+ const unsigned int i,
+ const Point<dim> & p) const
+{
+ return compute_derivative<1>(i, p);
+}
+
+
+
+template <int dim>
+inline Tensor<2, dim>
+PolynomialsRannacherTurek<dim>::compute_2nd_derivative(
+ const unsigned int i,
+ const Point<dim> & p) const
+{
+ return compute_derivative<2>(i, p);
+}
+
+
+
+template <int dim>
+inline Tensor<3, dim>
+PolynomialsRannacherTurek<dim>::compute_3rd_derivative(
+ const unsigned int i,
+ const Point<dim> & p) const
+{
+ return compute_derivative<3>(i, p);
+}
+
+
+
+template <int dim>
+inline Tensor<4, dim>
+PolynomialsRannacherTurek<dim>::compute_4th_derivative(
+ const unsigned int i,
+ const Point<dim> & p) const
+{
+ return compute_derivative<4>(i, p);
+}
+
+
+
template <int dim>
inline std::string
PolynomialsRannacherTurek<dim>::name() const
* Consider using compute() instead.
*/
virtual double
- compute_value(const unsigned int /*i*/, const Point<dim> & /*p*/) const
- {
- Assert(false, ExcNotImplemented());
- return 0;
- }
+ compute_value(const unsigned int /*i*/, const Point<dim> & /*p*/) const = 0;
/**
* Compute the <tt>order</tt>th derivative of the <tt>i</tt>th polynomial
*/
template <int order>
Tensor<order, dim>
- compute_derivative(const unsigned int /*i*/, const Point<dim> & /*p*/) const
- {
- Assert(false, ExcNotImplemented());
- Tensor<order, dim> empty;
- return empty;
- }
+ compute_derivative(const unsigned int i, const Point<dim> &p) const;
+
+ /**
+ * Compute the first derivative of the <tt>i</tt>th polynomial
+ * at unit point <tt>p</tt>.
+ *
+ * Consider using evaluate() instead.
+ */
+ virtual Tensor<1, dim>
+ compute_1st_derivative(const unsigned int i, const Point<dim> &p) const = 0;
+
+ /**
+ * Compute the second derivative of the <tt>i</tt>th polynomial
+ * at unit point <tt>p</tt>.
+ *
+ * Consider using evaluate() instead.
+ */
+ virtual Tensor<2, dim>
+ compute_2nd_derivative(const unsigned int i, const Point<dim> &p) const = 0;
+
+ /**
+ * Compute the third derivative of the <tt>i</tt>th polynomial
+ * at unit point <tt>p</tt>.
+ *
+ * Consider using evaluate() instead.
+ */
+ virtual Tensor<3, dim>
+ compute_3rd_derivative(const unsigned int i, const Point<dim> &p) const = 0;
+
+ /**
+ * Compute the fourth derivative of the <tt>i</tt>th polynomial
+ * at unit point <tt>p</tt>.
+ *
+ * Consider using evaluate() instead.
+ */
+ virtual Tensor<4, dim>
+ compute_4th_derivative(const unsigned int i, const Point<dim> &p) const = 0;
/**
* Compute the gradient of the <tt>i</tt>th polynomial at unit point
* Consider using compute() instead.
*/
virtual Tensor<1, dim>
- compute_grad(const unsigned int /*i*/, const Point<dim> & /*p*/) const
- {
- Assert(false, ExcNotImplemented());
- Tensor<1, dim> empty;
- return empty;
- }
+ compute_grad(const unsigned int /*i*/, const Point<dim> & /*p*/) const = 0;
/**
* Compute the second derivative (grad_grad) of the <tt>i</tt>th polynomial
* Consider using compute() instead.
*/
virtual Tensor<2, dim>
- compute_grad_grad(const unsigned int /*i*/, const Point<dim> & /*p*/) const
- {
- Assert(false, ExcNotImplemented());
- Tensor<2, dim> empty;
- return empty;
- }
+ compute_grad_grad(const unsigned int /*i*/,
+ const Point<dim> & /*p*/) const = 0;
/**
* Return the number of polynomials.
+template <int dim>
+template <int order>
+inline Tensor<order, dim>
+ScalarPolynomialsBase<dim>::compute_derivative(const unsigned int i,
+ const Point<dim> & p) const
+{
+ if (order == 1)
+ {
+ auto derivative = compute_1st_derivative(i, p);
+ return *reinterpret_cast<Tensor<order, dim> *>(&derivative);
+ }
+ if (order == 2)
+ {
+ auto derivative = compute_2nd_derivative(i, p);
+ return *reinterpret_cast<Tensor<order, dim> *>(&derivative);
+ }
+ if (order == 3)
+ {
+ auto derivative = compute_3rd_derivative(i, p);
+ return *reinterpret_cast<Tensor<order, dim> *>(&derivative);
+ }
+ if (order == 4)
+ {
+ auto derivative = compute_4th_derivative(i, p);
+ return *reinterpret_cast<Tensor<order, dim> *>(&derivative);
+ }
+ Assert(false, ExcNotImplemented());
+ Tensor<order, dim> empty;
+ return empty;
+}
+
DEAL_II_NAMESPACE_CLOSE
#endif
Tensor<order, dim>
compute_derivative(const unsigned int i, const Point<dim> &p) const;
+ /**
+ * @copydoc ScalarPolynomialsBase::compute_1st_derivative()
+ */
+ virtual Tensor<1, dim>
+ compute_1st_derivative(const unsigned int i,
+ const Point<dim> & p) const override;
+
+ /**
+ * @copydoc ScalarPolynomialsBase::compute_2nd_derivative()
+ */
+ virtual Tensor<2, dim>
+ compute_2nd_derivative(const unsigned int i,
+ const Point<dim> & p) const override;
+
+ /**
+ * @copydoc ScalarPolynomialsBase::compute_3rd_derivative()
+ */
+ virtual Tensor<3, dim>
+ compute_3rd_derivative(const unsigned int i,
+ const Point<dim> & p) const override;
+
+ /**
+ * @copydoc ScalarPolynomialsBase::compute_4th_derivative()
+ */
+ virtual Tensor<4, dim>
+ compute_4th_derivative(const unsigned int i,
+ const Point<dim> & p) const override;
+
/**
* Compute the grad of the <tt>i</tt>th tensor product polynomial at
* <tt>unit_point</tt>. Here <tt>i</tt> is given in tensor product
Tensor<order, dim>
compute_derivative(const unsigned int i, const Point<dim> &p) const;
+ /**
+ * @copydoc ScalarPolynomialsBase::compute_1st_derivative()
+ */
+ virtual Tensor<1, dim>
+ compute_1st_derivative(const unsigned int i,
+ const Point<dim> & p) const override;
+
+ /**
+ * @copydoc ScalarPolynomialsBase::compute_2nd_derivative()
+ */
+ virtual Tensor<2, dim>
+ compute_2nd_derivative(const unsigned int i,
+ const Point<dim> & p) const override;
+
+ /**
+ * @copydoc ScalarPolynomialsBase::compute_3rd_derivative()
+ */
+ virtual Tensor<3, dim>
+ compute_3rd_derivative(const unsigned int i,
+ const Point<dim> & p) const override;
+
+ /**
+ * @copydoc ScalarPolynomialsBase::compute_4th_derivative()
+ */
+ virtual Tensor<4, dim>
+ compute_4th_derivative(const unsigned int i,
+ const Point<dim> & p) const override;
+
/**
* Compute the grad of the <tt>i</tt>th tensor product polynomial at
* <tt>unit_point</tt>. Here <tt>i</tt> is given in tensor product
}
}
+
+
+template <int dim, typename PolynomialType>
+inline Tensor<1, dim>
+TensorProductPolynomials<dim, PolynomialType>::compute_1st_derivative(
+ const unsigned int i,
+ const Point<dim> & p) const
+{
+ return compute_derivative<1>(i, p);
+}
+
+
+
+template <int dim, typename PolynomialType>
+inline Tensor<2, dim>
+TensorProductPolynomials<dim, PolynomialType>::compute_2nd_derivative(
+ const unsigned int i,
+ const Point<dim> & p) const
+{
+ return compute_derivative<2>(i, p);
+}
+
+
+
+template <int dim, typename PolynomialType>
+inline Tensor<3, dim>
+TensorProductPolynomials<dim, PolynomialType>::compute_3rd_derivative(
+ const unsigned int i,
+ const Point<dim> & p) const
+{
+ return compute_derivative<3>(i, p);
+}
+
+
+
+template <int dim, typename PolynomialType>
+inline Tensor<4, dim>
+TensorProductPolynomials<dim, PolynomialType>::compute_4th_derivative(
+ const unsigned int i,
+ const Point<dim> & p) const
+{
+ return compute_derivative<4>(i, p);
+}
+
+
+
template <int dim>
template <int order>
Tensor<order, dim>
}
+
+template <int dim>
+inline Tensor<1, dim>
+AnisotropicPolynomials<dim>::compute_1st_derivative(const unsigned int i,
+ const Point<dim> & p) const
+{
+ return compute_derivative<1>(i, p);
+}
+
+
+
+template <int dim>
+inline Tensor<2, dim>
+AnisotropicPolynomials<dim>::compute_2nd_derivative(const unsigned int i,
+ const Point<dim> & p) const
+{
+ return compute_derivative<2>(i, p);
+}
+
+
+
+template <int dim>
+inline Tensor<3, dim>
+AnisotropicPolynomials<dim>::compute_3rd_derivative(const unsigned int i,
+ const Point<dim> & p) const
+{
+ return compute_derivative<3>(i, p);
+}
+
+
+
+template <int dim>
+inline Tensor<4, dim>
+AnisotropicPolynomials<dim>::compute_4th_derivative(const unsigned int i,
+ const Point<dim> & p) const
+{
+ return compute_derivative<4>(i, p);
+}
+
+
+
template <int dim>
inline std::string
AnisotropicPolynomials<dim>::name() const
Tensor<order, dim>
compute_derivative(const unsigned int i, const Point<dim> &p) const;
+ /**
+ * @copydoc ScalarPolynomialsBase::compute_1st_derivative()
+ */
+ virtual Tensor<1, dim>
+ compute_1st_derivative(const unsigned int i,
+ const Point<dim> & p) const override;
+
+ /**
+ * @copydoc ScalarPolynomialsBase::compute_2nd_derivative()
+ */
+ virtual Tensor<2, dim>
+ compute_2nd_derivative(const unsigned int i,
+ const Point<dim> & p) const override;
+
+ /**
+ * @copydoc ScalarPolynomialsBase::compute_3rd_derivative()
+ */
+ virtual Tensor<3, dim>
+ compute_3rd_derivative(const unsigned int i,
+ const Point<dim> & p) const override;
+
+ /**
+ * @copydoc ScalarPolynomialsBase::compute_4th_derivative()
+ */
+ virtual Tensor<4, dim>
+ compute_4th_derivative(const unsigned int i,
+ const Point<dim> & p) const override;
+
/**
* Compute the grad of the <tt>i</tt>th tensor product polynomial at
* <tt>unit_point</tt>. Here <tt>i</tt> is given in tensor product
}
+
+template <int dim>
+inline Tensor<1, dim>
+TensorProductPolynomialsBubbles<dim>::compute_1st_derivative(
+ const unsigned int i,
+ const Point<dim> & p) const
+{
+ return compute_derivative<1>(i, p);
+}
+
+
+
+template <int dim>
+inline Tensor<2, dim>
+TensorProductPolynomialsBubbles<dim>::compute_2nd_derivative(
+ const unsigned int i,
+ const Point<dim> & p) const
+{
+ return compute_derivative<2>(i, p);
+}
+
+
+
+template <int dim>
+inline Tensor<3, dim>
+TensorProductPolynomialsBubbles<dim>::compute_3rd_derivative(
+ const unsigned int i,
+ const Point<dim> & p) const
+{
+ return compute_derivative<3>(i, p);
+}
+
+
+
+template <int dim>
+inline Tensor<4, dim>
+TensorProductPolynomialsBubbles<dim>::compute_4th_derivative(
+ const unsigned int i,
+ const Point<dim> & p) const
+{
+ return compute_derivative<4>(i, p);
+}
+
#endif // DOXYGEN
DEAL_II_NAMESPACE_CLOSE
Tensor<order, dim>
compute_derivative(const unsigned int i, const Point<dim> &p) const;
+ /**
+ * @copydoc ScalarPolynomialsBase::compute_1st_derivative()
+ */
+ virtual Tensor<1, dim>
+ compute_1st_derivative(const unsigned int i,
+ const Point<dim> & p) const override;
+
+ /**
+ * @copydoc ScalarPolynomialsBase::compute_2nd_derivative()
+ */
+ virtual Tensor<2, dim>
+ compute_2nd_derivative(const unsigned int i,
+ const Point<dim> & p) const override;
+
+ /**
+ * @copydoc ScalarPolynomialsBase::compute_3rd_derivative()
+ */
+ virtual Tensor<3, dim>
+ compute_3rd_derivative(const unsigned int i,
+ const Point<dim> & p) const override;
+
+ /**
+ * @copydoc ScalarPolynomialsBase::compute_4th_derivative()
+ */
+ virtual Tensor<4, dim>
+ compute_4th_derivative(const unsigned int i,
+ const Point<dim> & p) const override;
+
/**
* Compute the grad of the <tt>i</tt>th tensor product polynomial at
* <tt>unit_point</tt>. Here <tt>i</tt> is given in tensor product
}
+
+template <int dim>
+inline Tensor<1, dim>
+TensorProductPolynomialsConst<dim>::compute_1st_derivative(
+ const unsigned int i,
+ const Point<dim> & p) const
+{
+ return compute_derivative<1>(i, p);
+}
+
+
+
+template <int dim>
+inline Tensor<2, dim>
+TensorProductPolynomialsConst<dim>::compute_2nd_derivative(
+ const unsigned int i,
+ const Point<dim> & p) const
+{
+ return compute_derivative<2>(i, p);
+}
+
+
+
+template <int dim>
+inline Tensor<3, dim>
+TensorProductPolynomialsConst<dim>::compute_3rd_derivative(
+ const unsigned int i,
+ const Point<dim> & p) const
+{
+ return compute_derivative<3>(i, p);
+}
+
+
+
+template <int dim>
+inline Tensor<4, dim>
+TensorProductPolynomialsConst<dim>::compute_4th_derivative(
+ const unsigned int i,
+ const Point<dim> & p) const
+{
+ return compute_derivative<4>(i, p);
+}
+
#endif // DOXYGEN
DEAL_II_NAMESPACE_CLOSE