* Return the gradient of the function
* at the given point.
*/
- virtual Point<dim> gradient (const Point<dim> &p) const;
+ virtual Tensor<1,dim> gradient (const Point<dim> &p) const;
};
};
-Point<2> Solution<2>::gradient (const Point<2> &p) const {
+Tensor<1,2> Solution<2>::gradient (const Point<2> &p) const {
const double x = p(0),
y = p(1);
const double pi= 3.1415926536;
class GaussShape : public Function<dim> {
public:
virtual double operator () (const Point<dim> &p) const;
- virtual Point<dim> gradient (const Point<dim> &p) const;
+ virtual Tensor<1,dim> gradient (const Point<dim> &p) const;
};
class Singular : public Function<dim> {
public:
virtual double operator () (const Point<dim> &p) const;
- virtual Point<dim> gradient (const Point<dim> &p) const;
+ virtual Tensor<1,dim> gradient (const Point<dim> &p) const;
};
class Kink : public Function<dim> {
};
virtual double operator () (const Point<dim> &p) const;
- virtual Point<dim> gradient (const Point<dim> &p) const;
+ virtual Tensor<1,dim> gradient (const Point<dim> &p) const;
};
};
};
-Point<2> Solution<2>::GaussShape::gradient (const Point<2> &p) const {
+Tensor<1,2> Solution<2>::GaussShape::gradient (const Point<2> &p) const {
return Point<2> ((1-80.*p(0)*p(0))*p(1)*exp(-40*p.square()),
(1-80.*p(1)*p(1))*p(0)*exp(-40*p.square()));
};
};
-Point<2> Solution<2>::Singular::gradient (const Point<2> &p) const {
+Tensor<1,2> Solution<2>::Singular::gradient (const Point<2> &p) const {
return 2./3.*pow(p.square(), -2./3.) * p;
};
};
-Point<2> Solution<2>::Kink::gradient (const Point<2> &p) const {
+Tensor<1,2> Solution<2>::Kink::gradient (const Point<2> &p) const {
const double s = p(1)-p(0)*p(0);
return (1+4*theta(s))*Point<2>(-2*p(0),1);
};
* Return the gradient of the function
* at the given point.
*/
- virtual Point<dim> gradient (const Point<dim> &p) const;
+ virtual Tensor<1,dim> gradient (const Point<dim> &p) const;
};
};
-Point<2> Solution<2>::gradient (const Point<2> &p) const {
+Tensor<1,2> Solution<2>::gradient (const Point<2> &p) const {
const double x = p(0),
y = p(1);
const double pi= 3.1415926536;
* Return the gradient of the function
* at the given point.
*/
- virtual Point<dim> gradient (const Point<dim> &p) const;
+ virtual Tensor<1,dim> gradient (const Point<dim> &p) const;
};
};
-Point<2> Solution<2>::gradient (const Point<2> &p) const {
+Tensor<1,2> Solution<2>::gradient (const Point<2> &p) const {
const double x = p(0),
y = p(1);
const double pi= 3.1415926536;
class GaussShape : public Function<dim> {
public:
virtual double operator () (const Point<dim> &p) const;
- virtual Point<dim> gradient (const Point<dim> &p) const;
+ virtual Tensor<1,dim> gradient (const Point<dim> &p) const;
};
class Singular : public Function<dim> {
public:
virtual double operator () (const Point<dim> &p) const;
- virtual Point<dim> gradient (const Point<dim> &p) const;
+ virtual Tensor<1,dim> gradient (const Point<dim> &p) const;
};
class Kink : public Function<dim> {
};
virtual double operator () (const Point<dim> &p) const;
- virtual Point<dim> gradient (const Point<dim> &p) const;
+ virtual Tensor<1,dim> gradient (const Point<dim> &p) const;
};
};
};
-Point<2> Solution<2>::GaussShape::gradient (const Point<2> &p) const {
+Tensor<1,2> Solution<2>::GaussShape::gradient (const Point<2> &p) const {
return Point<2> ((1-80.*p(0)*p(0))*p(1)*exp(-40*p.square()),
(1-80.*p(1)*p(1))*p(0)*exp(-40*p.square()));
};
};
-Point<2> Solution<2>::Singular::gradient (const Point<2> &p) const {
+Tensor<1,2> Solution<2>::Singular::gradient (const Point<2> &p) const {
return 2./3.*pow(p.square(), -2./3.) * p;
};
};
-Point<2> Solution<2>::Kink::gradient (const Point<2> &p) const {
+Tensor<1,2> Solution<2>::Kink::gradient (const Point<2> &p) const {
const double s = p(1)-p(0)*p(0);
return (1+4*theta(s))*Point<2>(-2*p(0),1);
};
* Return the gradient of the function
* at the given point.
*/
- virtual Point<dim> gradient (const Point<dim> &p) const;
+ virtual Tensor<1,dim> gradient (const Point<dim> &p) const;
};
};
-Point<2> Solution<2>::gradient (const Point<2> &p) const {
+Tensor<1,2> Solution<2>::gradient (const Point<2> &p) const {
const double x = p(0),
y = p(1);
const double pi= 3.1415926536;