From: bangerth Date: Fri, 18 May 2012 12:49:31 +0000 (+0000) Subject: Make naming uniform: call second derivatives "hessians" as everywhere else, rather... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8f83a67dd489c5f70178ba0637232c645271e1e2;p=dealii-svn.git Make naming uniform: call second derivatives "hessians" as everywhere else, rather than "grad_grad". git-svn-id: https://svn.dealii.org/branches/branch_higher_derivatives@25516 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h index 02e374c4fb..5d0da0b9a9 100644 --- a/deal.II/doc/news/changes.h +++ b/deal.II/doc/news/changes.h @@ -42,6 +42,20 @@ used for boundary indicators. + + + +
    +
  1. Changed: In many places throughout the library, second derivatives +were previously referred to uniformly as "Hessians" of some function. +However, in the internal interfaces of the finite element classes, we still +used an older name, "grad_grad". This has now changed. None of these +renamed functions should be used in user programs, however. +
    +(Bärbel Janssen, Wolfgang Bangerth, 2012/05/18) +
+ +

General

diff --git a/deal.II/include/deal.II/base/polynomial_space.h b/deal.II/include/deal.II/base/polynomial_space.h index eca0b00355..1caa9e997a 100644 --- a/deal.II/include/deal.II/base/polynomial_space.h +++ b/deal.II/include/deal.II/base/polynomial_space.h @@ -146,14 +146,14 @@ class PolynomialSpace * than using any of the * compute_value(), * compute_grad() or - * compute_grad_grad() + * compute_hessian() * functions, see below, in a * loop over all polynomials. */ void compute (const Point &unit_point, std::vector &values, std::vector > &grads, - std::vector > &grad_grads) const; + std::vector > &hessians) const; /** * Computes the value of the @@ -177,13 +177,13 @@ class PolynomialSpace /** * Computes the second derivative - * (grad_grad) of the ith + * (hessian) of the ith * polynomial at * unit_point. * * Consider using compute() instead. */ - Tensor<2,dim> compute_grad_grad (const unsigned int i, + Tensor<2,dim> compute_hessian (const unsigned int i, const Point &p) const; /** diff --git a/deal.II/include/deal.II/base/polynomials_abf.h b/deal.II/include/deal.II/base/polynomials_abf.h index fb21de59b3..0979ac5990 100644 --- a/deal.II/include/deal.II/base/polynomials_abf.h +++ b/deal.II/include/deal.II/base/polynomials_abf.h @@ -88,7 +88,7 @@ class PolynomialsABF * using any of the * compute_value, * compute_grad or - * compute_grad_grad + * compute_hessian * functions, see below, in a * loop over all tensor product * polynomials. @@ -96,7 +96,7 @@ class PolynomialsABF void compute (const Point &unit_point, std::vector > &values, std::vector > &grads, - std::vector > &grad_grads) const; + std::vector > &hessians) const; /** * Returns the number of ABF polynomials. @@ -168,7 +168,7 @@ class PolynomialsABF /** * Auxiliary memory. */ - mutable std::vector > p_grad_grads; + mutable std::vector > p_hessians; }; diff --git a/deal.II/include/deal.II/base/polynomials_adini.h b/deal.II/include/deal.II/base/polynomials_adini.h index 17798dcae7..89c324d368 100644 --- a/deal.II/include/deal.II/base/polynomials_adini.h +++ b/deal.II/include/deal.II/base/polynomials_adini.h @@ -64,7 +64,7 @@ class PolynomialsAdini * than using any of the * compute_value(), * compute_grad() or - * compute_grad_grad() + * compute_hessian() * functions, see below, in a * loop over all polynomials. */ @@ -72,7 +72,7 @@ class PolynomialsAdini void compute (const Point<2> &unit_point, std::vector &values, std::vector > &grads, - std::vector< Tensor<2,2> > &grad_grads) const; + std::vector< Tensor<2,2> > &hessians) const; /** * Computes the value of the @@ -97,15 +97,15 @@ class PolynomialsAdini const Point<2> &p) const; /** * Computes the second derivative - * (grad_grad) of the ith + * (hessian) of the ith * polynomial at * unit_point. * * Consider using compute() instead. */ - Tensor<2,2> compute_grad_grad (const unsigned int i, const Point<2> &p) const; - Tensor<2,2> compute_grad_grad_2 (const unsigned int i, const Point<2> &p) const; + Tensor<2,2> compute_hessian (const unsigned int i, const Point<2> &p) const; + Tensor<2,2> compute_hessian_2 (const unsigned int i, const Point<2> &p) const; private: /** diff --git a/deal.II/include/deal.II/base/polynomials_bdm.h b/deal.II/include/deal.II/base/polynomials_bdm.h index b5bd31e2f7..67268e7c83 100644 --- a/deal.II/include/deal.II/base/polynomials_bdm.h +++ b/deal.II/include/deal.II/base/polynomials_bdm.h @@ -91,7 +91,7 @@ class PolynomialsBDM * using any of the * compute_value, * compute_grad or - * compute_grad_grad + * compute_hessian * functions, see below, in a * loop over all tensor product * polynomials. @@ -99,7 +99,7 @@ class PolynomialsBDM void compute (const Point &unit_point, std::vector > &values, std::vector > &grads, - std::vector > &grad_grads) const; + std::vector > &hessians) const; /** * Returns the number of BDM polynomials. @@ -173,7 +173,7 @@ class PolynomialsBDM /** * Auxiliary memory. */ - mutable std::vector > p_grad_grads; + mutable std::vector > p_hessians; }; diff --git a/deal.II/include/deal.II/base/polynomials_nedelec.h b/deal.II/include/deal.II/base/polynomials_nedelec.h index 5e77df2bd3..7eab9a70fb 100644 --- a/deal.II/include/deal.II/base/polynomials_nedelec.h +++ b/deal.II/include/deal.II/base/polynomials_nedelec.h @@ -80,12 +80,12 @@ class PolynomialsNedelec * using any of the * compute_value, * compute_grad or - * compute_grad_grad + * compute_hessian * functions, see below, in a * loop over all tensor product * polynomials. */ - void compute (const Point &unit_point, std::vector > &values, std::vector > &grads, std::vector > &grad_grads) const; + void compute (const Point &unit_point, std::vector > &values, std::vector > &grads, std::vector > &hessians) const; /** * Returns the number of Nédélec diff --git a/deal.II/include/deal.II/base/polynomials_raviart_thomas.h b/deal.II/include/deal.II/base/polynomials_raviart_thomas.h index 0c112f983c..41fcea1856 100644 --- a/deal.II/include/deal.II/base/polynomials_raviart_thomas.h +++ b/deal.II/include/deal.II/base/polynomials_raviart_thomas.h @@ -79,7 +79,7 @@ class PolynomialsRaviartThomas * using any of the * compute_value, * compute_grad or - * compute_grad_grad + * compute_hessian * functions, see below, in a * loop over all tensor product * polynomials. @@ -87,7 +87,7 @@ class PolynomialsRaviartThomas void compute (const Point &unit_point, std::vector > &values, std::vector > &grads, - std::vector > &grad_grads) const; + std::vector > &hessians) const; /** * Returns the number of Raviart-Thomas polynomials. diff --git a/deal.II/include/deal.II/base/tensor_product_polynomials.h b/deal.II/include/deal.II/base/tensor_product_polynomials.h index 7837939db6..8108852dc9 100644 --- a/deal.II/include/deal.II/base/tensor_product_polynomials.h +++ b/deal.II/include/deal.II/base/tensor_product_polynomials.h @@ -127,7 +127,7 @@ class TensorProductPolynomials * using any of the * compute_value(), * compute_grad() or - * compute_grad_grad() + * compute_hessian() * functions, see below, in a * loop over all tensor product * polynomials. @@ -135,7 +135,7 @@ class TensorProductPolynomials void compute (const Point &unit_point, std::vector &values, std::vector > &grads, - std::vector > &grad_grads) const; + std::vector > &hessians) const; /** * Computes the value of the @@ -192,7 +192,7 @@ class TensorProductPolynomials /** * Computes the second - * derivative (grad_grad) of the + * derivative (hessian) of the * ith tensor product * polynomial at * unit_point. Here i is @@ -209,13 +209,13 @@ class TensorProductPolynomials * computed several times. * Instead use the compute() * function, see above, with - * grad_grads.size()==n() + * hessians.size()==n() * to get the point value of all * tensor polynomials all at once * and in a much more efficient * way. */ - Tensor<2,dim> compute_grad_grad (const unsigned int i, + Tensor<2,dim> compute_hessian (const unsigned int i, const Point &p) const; /** @@ -358,7 +358,7 @@ class AnisotropicPolynomials * using any of the * compute_value, * compute_grad or - * compute_grad_grad + * compute_hessian * functions, see below, in a * loop over all tensor product * polynomials. @@ -366,7 +366,7 @@ class AnisotropicPolynomials void compute (const Point &unit_point, std::vector &values, std::vector > &grads, - std::vector > &grad_grads) const; + std::vector > &hessians) const; /** * Computes the value of the @@ -424,7 +424,7 @@ class AnisotropicPolynomials /** * Computes the second - * derivative (grad_grad) of the + * derivative (hessian) of the * ith tensor product * polynomial at * unit_point. Here i is @@ -441,13 +441,13 @@ class AnisotropicPolynomials * computed several times. * Instead use the compute * function, see above, with - * grad_grads.size()==n_tensor_pols + * hessians.size()==n_tensor_pols * to get the point value of all * tensor polynomials all at once * and in a much more efficient * way. */ - Tensor<2,dim> compute_grad_grad (const unsigned int i, + Tensor<2,dim> compute_hessian (const unsigned int i, const Point &p) const; /** diff --git a/deal.II/include/deal.II/fe/fe.h b/deal.II/include/deal.II/fe/fe.h index 66c0759613..c49c12cd81 100644 --- a/deal.II/include/deal.II/fe/fe.h +++ b/deal.II/include/deal.II/fe/fe.h @@ -595,7 +595,7 @@ class FiniteElement : public Subscriptor, * exception of type * ExcShapeFunctionNotPrimitive. In * that case, use the - * shape_grad_grad_component() + * shape_hessian_component() * function. * * An @@ -606,11 +606,11 @@ class FiniteElement : public Subscriptor, * shape of the cell in real * space. */ - virtual Tensor<2,dim> shape_grad_grad (const unsigned int i, + virtual Tensor<2,dim> shape_hessian (const unsigned int i, const Point &p) const; /** - * Just like for shape_grad_grad(), + * Just like for shape_hessian(), * but this function will be * called when the shape function * has more than one non-zero @@ -621,9 +621,10 @@ class FiniteElement : public Subscriptor, * component of the @p ith shape * function at point @p p. */ - virtual Tensor<2,dim> shape_grad_grad_component (const unsigned int i, + virtual Tensor<2,dim> shape_hessian_component (const unsigned int i, const Point &p, const unsigned int component) const; + /** * Check for non-zero values on a * face in order to optimize out diff --git a/deal.II/include/deal.II/fe/fe_dgp_nonparametric.h b/deal.II/include/deal.II/fe/fe_dgp_nonparametric.h index 22522b1490..a0284c188f 100644 --- a/deal.II/include/deal.II/fe/fe_dgp_nonparametric.h +++ b/deal.II/include/deal.II/fe/fe_dgp_nonparametric.h @@ -148,7 +148,7 @@ class FE_DGPNonparametric : public FiniteElement * about the semantics of this * function. */ - virtual Tensor<2,dim> shape_grad_grad (const unsigned int i, + virtual Tensor<2,dim> shape_hessian (const unsigned int i, const Point &p) const; /** @@ -169,7 +169,7 @@ class FE_DGPNonparametric : public FiniteElement * called, provided that the * specified component is zero. */ - virtual Tensor<2,dim> shape_grad_grad_component (const unsigned int i, + virtual Tensor<2,dim> shape_hessian_component (const unsigned int i, const Point &p, const unsigned int component) const; @@ -565,7 +565,7 @@ class FE_DGPNonparametric : public FiniteElement // have some scratch arrays std::vector values; std::vector > grads; - std::vector > grad_grads; + std::vector > hessians; }; /** diff --git a/deal.II/include/deal.II/fe/fe_poly.h b/deal.II/include/deal.II/fe/fe_poly.h index 437dee900c..ca0da2666e 100644 --- a/deal.II/include/deal.II/fe/fe_poly.h +++ b/deal.II/include/deal.II/fe/fe_poly.h @@ -37,7 +37,7 @@ DEAL_II_NAMESPACE_OPEN * Tensor<1,dim> compute_grad (const unsigned int i, * const Point &p) const; * - * Tensor<2,dim> compute_grad_grad (const unsigned int i, + * Tensor<2,dim> compute_hessian (const unsigned int i, * const Point &p) const; * @endcode * Example classes are TensorProductPolynomials, PolynomialSpace or @@ -171,7 +171,7 @@ class FE_Poly : public FiniteElement * for more information about the * semantics of this function. */ - virtual Tensor<2,dim> shape_grad_grad (const unsigned int i, + virtual Tensor<2,dim> shape_hessian (const unsigned int i, const Point &p) const; /** @@ -191,7 +191,7 @@ class FE_Poly : public FiniteElement * were called, provided that the * specified component is zero. */ - virtual Tensor<2,dim> shape_grad_grad_component (const unsigned int i, + virtual Tensor<2,dim> shape_hessian_component (const unsigned int i, const Point &p, const unsigned int component) const; protected: diff --git a/deal.II/include/deal.II/fe/fe_poly.templates.h b/deal.II/include/deal.II/fe/fe_poly.templates.h index cc79e573ab..4fe053bdf9 100644 --- a/deal.II/include/deal.II/fe/fe_poly.templates.h +++ b/deal.II/include/deal.II/fe/fe_poly.templates.h @@ -90,24 +90,24 @@ FE_Poly::shape_grad_component (const unsigned int i, template Tensor<2,dim> -FE_Poly::shape_grad_grad (const unsigned int i, +FE_Poly::shape_hessian (const unsigned int i, const Point &p) const { Assert (idofs_per_cell, ExcIndexRange(i,0,this->dofs_per_cell)); - return poly_space.compute_grad_grad(i, p); + return poly_space.compute_hessian(i, p); } template Tensor<2,dim> -FE_Poly::shape_grad_grad_component (const unsigned int i, +FE_Poly::shape_hessian_component (const unsigned int i, const Point &p, const unsigned int component) const { Assert (idofs_per_cell, ExcIndexRange(i,0,this->dofs_per_cell)); Assert (component == 0, ExcIndexRange (component, 0, 1)); - return poly_space.compute_grad_grad(i, p); + return poly_space.compute_hessian(i, p); } @@ -179,7 +179,7 @@ FE_Poly::get_data (const UpdateFlags update_flags, // some scratch arrays std::vector values(0); std::vector > grads(0); - std::vector > grad_grads(0); + std::vector > hessians(0); // initialize fields only if really // necessary. otherwise, don't @@ -216,7 +216,7 @@ FE_Poly::get_data (const UpdateFlags update_flags, for (unsigned int i=0; idofs_per_cell; ++k) diff --git a/deal.II/include/deal.II/fe/fe_poly_face.h b/deal.II/include/deal.II/fe/fe_poly_face.h index 310cce6e3e..876ad69ecd 100644 --- a/deal.II/include/deal.II/fe/fe_poly_face.h +++ b/deal.II/include/deal.II/fe/fe_poly_face.h @@ -146,7 +146,7 @@ class FE_PolyFace : public FiniteElement * for more information about the * semantics of this function. */ -// virtual Tensor<2,dim> shape_grad_grad (const unsigned int i, +// virtual Tensor<2,dim> shape_hessian (const unsigned int i, // const Point &p) const; /** @@ -166,7 +166,7 @@ class FE_PolyFace : public FiniteElement * were called, provided that the * specified component is zero. */ -// virtual Tensor<2,dim> shape_grad_grad_component (const unsigned int i, +// virtual Tensor<2,dim> shape_hessian_component (const unsigned int i, // const Point &p, // const unsigned int component) const; diff --git a/deal.II/include/deal.II/fe/fe_poly_face.templates.h b/deal.II/include/deal.II/fe/fe_poly_face.templates.h index 65f65a5095..049116df70 100644 --- a/deal.II/include/deal.II/fe/fe_poly_face.templates.h +++ b/deal.II/include/deal.II/fe/fe_poly_face.templates.h @@ -119,7 +119,7 @@ FE_PolyFace::get_face_data ( // some scratch arrays std::vector values(0); std::vector > grads(0); - std::vector > grad_grads(0); + std::vector > hessians(0); // initialize fields only if really // necessary. otherwise, don't @@ -132,7 +132,7 @@ FE_PolyFace::get_face_data ( for (unsigned int i=0; ishape_values[k][i] = values[k]; diff --git a/deal.II/include/deal.II/fe/fe_poly_tensor.h b/deal.II/include/deal.II/fe/fe_poly_tensor.h index 14562bf88f..065b4f1cef 100644 --- a/deal.II/include/deal.II/fe/fe_poly_tensor.h +++ b/deal.II/include/deal.II/fe/fe_poly_tensor.h @@ -31,7 +31,7 @@ DEAL_II_NAMESPACE_OPEN * void compute (const Point &unit_point, * std::vector > &values, * std::vector > &grads, - * std::vector > &grad_grads) const; + * std::vector > &hessians) const; * @endcode * * In many cases, the node functionals depend on the shape of the mesh @@ -157,10 +157,10 @@ class FE_PolyTensor : public FiniteElement * vector valued, an exception is * thrown. */ - virtual Tensor<2,dim> shape_grad_grad (const unsigned int i, + virtual Tensor<2,dim> shape_hessian (const unsigned int i, const Point &p) const; - virtual Tensor<2,dim> shape_grad_grad_component (const unsigned int i, + virtual Tensor<2,dim> shape_hessian_component (const unsigned int i, const Point &p, const unsigned int component) const; @@ -329,9 +329,9 @@ class FE_PolyTensor : public FiniteElement /** * Cached second derivatives of * shape functions after call to - * shape_grad_grad_component(). + * shape_hessian_component(). */ - mutable std::vector > cached_grad_grads; + mutable std::vector > cached_hessians; }; DEAL_II_NAMESPACE_CLOSE diff --git a/deal.II/include/deal.II/fe/fe_system.h b/deal.II/include/deal.II/fe/fe_system.h index 2e7fceabc9..e76533bb19 100644 --- a/deal.II/include/deal.II/fe/fe_system.h +++ b/deal.II/include/deal.II/fe/fe_system.h @@ -389,7 +389,7 @@ class FESystem : public FiniteElement * shape of the cell in real * space. */ - virtual Tensor<2,dim> shape_grad_grad (const unsigned int i, + virtual Tensor<2,dim> shape_hessian (const unsigned int i, const Point &p) const; /** @@ -410,7 +410,7 @@ class FESystem : public FiniteElement */ virtual Tensor<2,dim> - shape_grad_grad_component (const unsigned int i, + shape_hessian_component (const unsigned int i, const Point &p, const unsigned int component) const; diff --git a/deal.II/include/deal.II/fe/fe_values.h b/deal.II/include/deal.II/fe/fe_values.h index c90121418c..c0e4504226 100644 --- a/deal.II/include/deal.II/fe/fe_values.h +++ b/deal.II/include/deal.II/fe/fe_values.h @@ -1957,7 +1957,7 @@ class FEValuesBase : protected FEValuesData, * exception of type * ExcShapeFunctionNotPrimitive. In * that case, use the - * shape_grad_grad_component() + * shape_hessian_component() * function. * * The same holds for the arguments diff --git a/deal.II/include/deal.II/matrix_free/shape_info.templates.h b/deal.II/include/deal.II/matrix_free/shape_info.templates.h index 2dbc45bc0f..a078f2c39d 100644 --- a/deal.II/include/deal.II/matrix_free/shape_info.templates.h +++ b/deal.II/include/deal.II/matrix_free/shape_info.templates.h @@ -133,7 +133,7 @@ namespace MatrixFreeFunctions shape_gradients[my_i*n_q_points_1d+q] = shape_gradient_number[my_i*n_q_points_1d+q]; shape_hessians[my_i*n_q_points_1d+q] = - fe.shape_grad_grad(i,q_point)[0][0]; + fe.shape_hessian(i,q_point)[0][0]; face_value[0][my_i*n_q_points_1d+q] = fe.shape_value(i,q_point*0.5); face_value[1][my_i*n_q_points_1d+q] = fe.shape_value(i,Point<1>(0.5)+q_point*0.5); } diff --git a/deal.II/source/base/polynomial_space.cc b/deal.II/source/base/polynomial_space.cc index ce3fdb3bd8..1199671b9a 100644 --- a/deal.II/source/base/polynomial_space.cc +++ b/deal.II/source/base/polynomial_space.cc @@ -168,7 +168,7 @@ PolynomialSpace::compute_grad (const unsigned int i, template Tensor<2,dim> -PolynomialSpace::compute_grad_grad (const unsigned int i, +PolynomialSpace::compute_hessian (const unsigned int i, const Point &p) const { unsigned int ix[dim]; @@ -209,7 +209,7 @@ void PolynomialSpace::compute (const Point &p, std::vector &values, std::vector > &grads, - std::vector > &grad_grads) const + std::vector > &hessians) const { const unsigned int n_1d=polynomials.size(); @@ -217,11 +217,11 @@ PolynomialSpace::compute (const Point &p, ExcDimensionMismatch2(values.size(), n_pols, 0)); Assert(grads.size()==n_pols|| grads.size()==0, ExcDimensionMismatch2(grads.size(), n_pols, 0)); - Assert(grad_grads.size()==n_pols|| grad_grads.size()==0, - ExcDimensionMismatch2(grad_grads.size(), n_pols, 0)); + Assert(hessians.size()==n_pols|| hessians.size()==0, + ExcDimensionMismatch2(hessians.size(), n_pols, 0)); unsigned int v_size=0; - bool update_values=false, update_grads=false, update_grad_grads=false; + bool update_values=false, update_grads=false, update_hessians=false; if (values.size()==n_pols) { update_values=true; @@ -232,9 +232,9 @@ PolynomialSpace::compute (const Point &p, update_grads=true; v_size=2; } - if (grad_grads.size()==n_pols) + if (hessians.size()==n_pols) { - update_grad_grads=true; + update_hessians=true; v_size=3; } @@ -281,7 +281,7 @@ PolynomialSpace::compute (const Point &p, } } - if (update_grad_grads) + if (update_hessians) { unsigned int k = 0; @@ -303,7 +303,7 @@ PolynomialSpace::compute (const Point &p, const unsigned int j2 = ((d1==2) ? 1 : 0) + ((d2==2) ? 1 : 0); - grad_grads[k2][d1][d2] = + hessians[k2][d1][d2] = v[0][ix][j0] * ((dim>1) ? v[1][iy][j1] : 1.) * ((dim>2) ? v[2][iz][j2] : 1.); diff --git a/deal.II/source/base/polynomials_abf.cc b/deal.II/source/base/polynomials_abf.cc index 51b120266f..cfd8ae2742 100644 --- a/deal.II/source/base/polynomials_abf.cc +++ b/deal.II/source/base/polynomials_abf.cc @@ -50,14 +50,14 @@ void PolynomialsABF::compute (const Point &unit_point, std::vector > &values, std::vector > &grads, - std::vector > &grad_grads) const + std::vector > &hessians) const { Assert(values.size()==n_pols || values.size()==0, ExcDimensionMismatch(values.size(), n_pols)); Assert(grads.size()==n_pols|| grads.size()==0, ExcDimensionMismatch(grads.size(), n_pols)); - Assert(grad_grads.size()==n_pols|| grad_grads.size()==0, - ExcDimensionMismatch(grad_grads.size(), n_pols)); + Assert(hessians.size()==n_pols|| hessians.size()==0, + ExcDimensionMismatch(hessians.size(), n_pols)); const unsigned int n_sub = polynomial_space->n(); // guard access to the scratch @@ -69,7 +69,7 @@ PolynomialsABF::compute (const Point &unit_point, p_values.resize((values.size() == 0) ? 0 : n_sub); p_grads.resize((grads.size() == 0) ? 0 : n_sub); - p_grad_grads.resize((grad_grads.size() == 0) ? 0 : n_sub); + p_hessians.resize((hessians.size() == 0) ? 0 : n_sub); for (unsigned int d=0;d::compute (const Point &unit_point, for (unsigned int c=0;ccompute (p, p_values, p_grads, p_grad_grads); + polynomial_space->compute (p, p_values, p_grads, p_hessians); for (unsigned int i=0;i::compute (const Point &unit_point, for (unsigned int d1=0;d1 &unit_point, std::vector &values, std::vector > &grads, - std::vector< Tensor<2,2> > &grad_grads) const + std::vector< Tensor<2,2> > &hessians) const { if(values.empty() == false)//nur dann was tun { @@ -133,11 +133,11 @@ PolynomialsAdini::compute (const Point<2> &unit_point, } } - if(grad_grads.empty() == false)//nur dann was tun + if(hessians.empty() == false)//nur dann was tun { - for(unsigned int i=0; i PolynomialsAdini::compute_grad (const unsigned int i, const Point<2> return tensor; } -Tensor<2,2> PolynomialsAdini::compute_grad_grad (const unsigned int i, const Point<2> &p) const +Tensor<2,2> PolynomialsAdini::compute_hessian (const unsigned int i, const Point<2> &p) const { const double x = p(0); const double y = p(1); diff --git a/deal.II/source/base/polynomials_bdm.cc b/deal.II/source/base/polynomials_bdm.cc index 70f96f0a80..df74decdad 100644 --- a/deal.II/source/base/polynomials_bdm.cc +++ b/deal.II/source/base/polynomials_bdm.cc @@ -27,7 +27,7 @@ PolynomialsBDM::PolynomialsBDM (const unsigned int k) n_pols(compute_n_pols(k)), p_values(polynomial_space.n()), p_grads(polynomial_space.n()), - p_grad_grads(polynomial_space.n()) + p_hessians(polynomial_space.n()) { switch(dim) { @@ -50,14 +50,14 @@ void PolynomialsBDM::compute (const Point &unit_point, std::vector > &values, std::vector > &grads, - std::vector > &grad_grads) const + std::vector > &hessians) const { Assert(values.size()==n_pols || values.size()==0, ExcDimensionMismatch(values.size(), n_pols)); Assert(grads.size()==n_pols|| grads.size()==0, ExcDimensionMismatch(grads.size(), n_pols)); - Assert(grad_grads.size()==n_pols|| grad_grads.size()==0, - ExcDimensionMismatch(grad_grads.size(), n_pols)); + Assert(hessians.size()==n_pols|| hessians.size()==0, + ExcDimensionMismatch(hessians.size(), n_pols)); const unsigned int n_sub = polynomial_space.n(); @@ -71,14 +71,14 @@ PolynomialsBDM::compute (const Point &unit_point, p_values.resize((values.size() == 0) ? 0 : n_sub); p_grads.resize((grads.size() == 0) ? 0 : n_sub); - p_grad_grads.resize((grad_grads.size() == 0) ? 0 : n_sub); + p_hessians.resize((hessians.size() == 0) ? 0 : n_sub); // Compute values of complete space // and insert into tensors. Result // will have first all polynomials // in the x-component, then y and // z. - polynomial_space.compute (unit_point, p_values, p_grads, p_grad_grads); + polynomial_space.compute (unit_point, p_values, p_grads, p_hessians); std::fill(values.begin(), values.end(), Tensor<1,dim>()); for (unsigned int i=0;i::compute (const Point &unit_point, for (unsigned int j=0;j()); - for (unsigned int i=0;i()); + for (unsigned int i=0;i::compute (const Point &unit_point, grads[start+1][1][0] = 0.; grads[start+1][1][1] = monovali[1][1]; } - if (grad_grads.size() != 0) + if (hessians.size() != 0) { - grad_grads[start][0][0][0] = monovali[0][2]; - grad_grads[start][0][0][1] = 0.; - grad_grads[start][0][1][0] = 0.; - grad_grads[start][0][1][1] = 0.; - grad_grads[start][1][0][0] = -unit_point(1) * monovali[0][3]; - grad_grads[start][1][0][1] = -monovali[0][2]; - grad_grads[start][1][1][0] = -monovali[0][2]; - grad_grads[start][1][1][1] = 0.; - grad_grads[start+1][0][0][0] = 0; - grad_grads[start+1][0][0][1] = -monovali[1][2]; - grad_grads[start+1][0][1][0] = -monovali[1][2]; - grad_grads[start+1][0][1][1] = -unit_point(0) * monovali[1][3]; - grad_grads[start+1][1][0][0] = 0.; - grad_grads[start+1][1][0][1] = 0.; - grad_grads[start+1][1][1][0] = 0.; - grad_grads[start+1][1][1][1] = monovali[1][2]; + hessians[start][0][0][0] = monovali[0][2]; + hessians[start][0][0][1] = 0.; + hessians[start][0][1][0] = 0.; + hessians[start][0][1][1] = 0.; + hessians[start][1][0][0] = -unit_point(1) * monovali[0][3]; + hessians[start][1][0][1] = -monovali[0][2]; + hessians[start][1][1][0] = -monovali[0][2]; + hessians[start][1][1][1] = 0.; + hessians[start+1][0][0][0] = 0; + hessians[start+1][0][0][1] = -monovali[1][2]; + hessians[start+1][0][1][0] = -monovali[1][2]; + hessians[start+1][0][1][1] = -unit_point(0) * monovali[1][3]; + hessians[start+1][1][0][0] = 0.; + hessians[start+1][1][0][1] = 0.; + hessians[start+1][1][1][0] = 0.; + hessians[start+1][1][1][1] = monovali[1][2]; } } else // dim == 3 @@ -222,7 +222,7 @@ PolynomialsBDM::compute (const Point &unit_point, grads[start+2][1][0] = 0.; grads[start+2][1][1] = 0.; } - if (grad_grads.size() != 0) + if (hessians.size() != 0) { Assert(false,ExcNotImplemented()); } @@ -245,7 +245,7 @@ PolynomialsBDM::compute_node_matrix (Table<2,double>& A) const std::vector > values(n()); std::vector > grads; - std::vector > grad_grads; + std::vector > hessians; values.resize(n()); for (unsigned int face=0;face<2*dim;++face) @@ -277,7 +277,7 @@ PolynomialsBDM::compute_node_matrix (Table<2,double>& A) const // << '\t' << moment_weight[1].value(x) // ; - compute (p, values, grads, grad_grads); + compute (p, values, grads, hessians); for (unsigned int i=0;i::compute (const Point &unit_point, std::vector > &values, std::vector > &grads, - std::vector > &grad_grads) + std::vector > &hessians) const { Assert(values.size () == n_pols || values.size () == 0, ExcDimensionMismatch(values.size (), n_pols)); Assert(grads.size () == n_pols || grads.size () == 0, ExcDimensionMismatch(grads.size (), n_pols)); - Assert(grad_grads.size () == n_pols || grad_grads.size () == 0, - ExcDimensionMismatch(grad_grads.size (), n_pols)); + Assert(hessians.size () == n_pols || hessians.size () == 0, + ExcDimensionMismatch(hessians.size (), n_pols)); // Declare the values, derivatives // and second derivatives vectors of @@ -57,14 +57,14 @@ const std::vector > unit_point_grads ((grads.size () == 0) ? 0 : n_basis); std::vector > - unit_point_grad_grads ((grad_grads.size () == 0) ? 0 : n_basis); + unit_point_hessians ((hessians.size () == 0) ? 0 : n_basis); switch (dim) { case 1: { polynomial_space.compute (unit_point, unit_point_values, - unit_point_grads, unit_point_grad_grads); + unit_point_grads, unit_point_hessians); // Assign the correct values to the // corresponding shape functions. @@ -76,9 +76,9 @@ const for (unsigned int i = 0; i < unit_point_grads.size (); ++i) grads[i][0][0] = unit_point_grads[i][0]; - if (grad_grads.size () > 0) - for (unsigned int i = 0; i < unit_point_grad_grads.size (); ++i) - grad_grads[i][0][0][0] = unit_point_grad_grads[i][0][0]; + if (hessians.size () > 0) + for (unsigned int i = 0; i < unit_point_hessians.size (); ++i) + hessians[i][0][0][0] = unit_point_hessians[i][0][0]; break; } @@ -86,7 +86,7 @@ const case 2: { polynomial_space.compute (unit_point, unit_point_values, - unit_point_grads, unit_point_grad_grads); + unit_point_grads, unit_point_hessians); // Declare the values, derivatives and // second derivatives vectors of @@ -102,9 +102,9 @@ const std::vector > p_grads ((grads.size () == 0) ? 0 : n_basis); std::vector > - p_grad_grads ((grad_grads.size () == 0) ? 0 : n_basis); + p_hessians ((hessians.size () == 0) ? 0 : n_basis); - polynomial_space.compute (p, p_values, p_grads, p_grad_grads); + polynomial_space.compute (p, p_values, p_grads, p_hessians); // Assign the correct values to the // corresponding shape functions. @@ -190,7 +190,7 @@ const } } - if (grad_grads.size () > 0) + if (hessians.size () > 0) { for (unsigned int i = 0; i <= my_degree; ++i) for (unsigned int j = 0; j < 2; ++j) @@ -198,22 +198,22 @@ const for (unsigned int k = 0; k < dim; ++k) for (unsigned int l = 0; l < dim; ++l) { - grad_grads[i + j * (my_degree + 1)][0][k][l] = 0.0; - grad_grads[i + (j + 2) * (my_degree + 1)][0][k][l] - = unit_point_grad_grads[i + j * (my_degree + 1)][k] + hessians[i + j * (my_degree + 1)][0][k][l] = 0.0; + hessians[i + (j + 2) * (my_degree + 1)][0][k][l] + = unit_point_hessians[i + j * (my_degree + 1)][k] [l]; - grad_grads[i + (j + 2) * (my_degree + 1)][1][k][l] + hessians[i + (j + 2) * (my_degree + 1)][1][k][l] = 0.0; } - grad_grads[i + j * (my_degree + 1)][1][0][0] - = p_grad_grads[i + j * (my_degree + 1)][1][1]; - grad_grads[i + j * (my_degree + 1)][1][0][1] - = p_grad_grads[i + j * (my_degree + 1)][1][0]; - grad_grads[i + j * (my_degree + 1)][1][1][0] - = p_grad_grads[i + j * (my_degree + 1)][0][1]; - grad_grads[i + j * (my_degree + 1)][1][1][1] - = p_grad_grads[i + j * (my_degree + 1)][0][0]; + hessians[i + j * (my_degree + 1)][1][0][0] + = p_hessians[i + j * (my_degree + 1)][1][1]; + hessians[i + j * (my_degree + 1)][1][0][1] + = p_hessians[i + j * (my_degree + 1)][1][0]; + hessians[i + j * (my_degree + 1)][1][1][0] + = p_hessians[i + j * (my_degree + 1)][0][1]; + hessians[i + j * (my_degree + 1)][1][1][1] + = p_hessians[i + j * (my_degree + 1)][0][0]; } if (my_degree > 0) @@ -223,37 +223,37 @@ const for (unsigned int k = 0; k < dim; ++k) for (unsigned int l = 0; l < dim; ++l) { - grad_grads[(i + GeometryInfo::lines_per_cell) + hessians[(i + GeometryInfo::lines_per_cell) * my_degree + j + GeometryInfo::lines_per_cell][0] [k][l] - = unit_point_grad_grads[i + (j + 2) + = unit_point_hessians[i + (j + 2) * (my_degree + 1)][k][l]; - grad_grads[(i + GeometryInfo::lines_per_cell) + hessians[(i + GeometryInfo::lines_per_cell) * my_degree + j + GeometryInfo::lines_per_cell][1] [k][l] = 0.0; - grad_grads[i + (j + my_degree + hessians[i + (j + my_degree + GeometryInfo::lines_per_cell) * (my_degree + 1)][0][k][l] = 0.0; } - grad_grads[i + (j + my_degree + hessians[i + (j + my_degree + GeometryInfo::lines_per_cell) * (my_degree + 1)][1][0][0] - = p_grad_grads[i + (j + 2) * (my_degree + 1)][1][1]; - grad_grads[i + (j + my_degree + = p_hessians[i + (j + 2) * (my_degree + 1)][1][1]; + hessians[i + (j + my_degree + GeometryInfo::lines_per_cell) * (my_degree + 1)][1][0][1] - = p_grad_grads[i + (j + 2) * (my_degree + 1)][1][0]; - grad_grads[i + (j + my_degree + = p_hessians[i + (j + 2) * (my_degree + 1)][1][0]; + hessians[i + (j + my_degree + GeometryInfo::lines_per_cell) * (my_degree + 1)][1][1][0] - = p_grad_grads[i + (j + 2) * (my_degree + 1)][0][1]; - grad_grads[i + (j + my_degree + = p_hessians[i + (j + 2) * (my_degree + 1)][0][1]; + hessians[i + (j + my_degree + GeometryInfo::lines_per_cell) * (my_degree + 1)][1][1][1] - = p_grad_grads[i + (j + 2) * (my_degree + 1)][0][0]; + = p_hessians[i + (j + 2) * (my_degree + 1)][0][0]; } } @@ -263,7 +263,7 @@ const case 3: { polynomial_space.compute (unit_point, unit_point_values, - unit_point_grads, unit_point_grad_grads); + unit_point_grads, unit_point_hessians); // Declare the values, derivatives // and second derivatives vectors of @@ -276,21 +276,21 @@ const std::vector > p1_grads ((grads.size () == 0) ? 0 : n_basis); std::vector > - p1_grad_grads ((grad_grads.size () == 0) ? 0 : n_basis); + p1_hessians ((hessians.size () == 0) ? 0 : n_basis); std::vector p2_values ((values.size () == 0) ? 0 : n_basis); std::vector > p2_grads ((grads.size () == 0) ? 0 : n_basis); std::vector > - p2_grad_grads ((grad_grads.size () == 0) ? 0 : n_basis); + p2_hessians ((hessians.size () == 0) ? 0 : n_basis); p1 (0) = unit_point (1); p1 (1) = unit_point (2); p1 (2) = unit_point (0); - polynomial_space.compute (p1, p1_values, p1_grads, p1_grad_grads); + polynomial_space.compute (p1, p1_values, p1_grads, p1_hessians); p2 (0) = unit_point (2); p2 (1) = unit_point (0); p2 (2) = unit_point (1); - polynomial_space.compute (p2, p2_values, p2_grads, p2_grad_grads); + polynomial_space.compute (p2, p2_values, p2_grads, p2_hessians); // Assign the correct values to the // corresponding shape functions. @@ -718,7 +718,7 @@ const } } - if (grad_grads.size () > 0) + if (hessians.size () > 0) { for (unsigned int i = 0; i <= my_degree; ++i) { @@ -731,137 +731,137 @@ const { for (unsigned int n = 0; n < 2; ++n) { - grad_grads[i + (j + 4 * k) * (my_degree + hessians[i + (j + 4 * k) * (my_degree + 1)][2 * n] [l][m] = 0.0; - grad_grads[i + (j + 4 * k + 2) * (my_degree + hessians[i + (j + 4 * k + 2) * (my_degree + 1)] [n + 1][l][m] = 0.0; - grad_grads[i + (j + 2 * (k + 4)) + hessians[i + (j + 2 * (k + 4)) * (my_degree + 1)][n][l][m] = 0.0; } - grad_grads[i + (j + 4 * k + 2) * (my_degree + hessians[i + (j + 4 * k + 2) * (my_degree + 1)][0][l][m] - = unit_point_grad_grads[i + (j + k + = unit_point_hessians[i + (j + k * (my_degree + 2)) * (my_degree + 1)][l] [m]; } - grad_grads[i + (j + 2 * (k + 4)) * (my_degree + 1)] + hessians[i + (j + 2 * (k + 4)) * (my_degree + 1)] [2][0][0] - = p2_grad_grads[i + (j + k * (my_degree + 2)) + = p2_hessians[i + (j + k * (my_degree + 2)) * (my_degree + 1)][1][1]; - grad_grads[i + (j + 2 * (k + 4)) * (my_degree + 1)] + hessians[i + (j + 2 * (k + 4)) * (my_degree + 1)] [2][0][1] - = p2_grad_grads[i + (j + k * (my_degree + 2)) + = p2_hessians[i + (j + k * (my_degree + 2)) * (my_degree + 1)][1][2]; - grad_grads[i + (j + 2 * (k + 4)) * (my_degree + 1)] + hessians[i + (j + 2 * (k + 4)) * (my_degree + 1)] [2][0][2] - = p2_grad_grads[i + (j + k * (my_degree + 2)) + = p2_hessians[i + (j + k * (my_degree + 2)) * (my_degree + 1)][1][0]; - grad_grads[i + (j + 2 * (k + 4)) * (my_degree + 1)] + hessians[i + (j + 2 * (k + 4)) * (my_degree + 1)] [2][1][0] - = p2_grad_grads[i + (j + k * (my_degree + 2)) + = p2_hessians[i + (j + k * (my_degree + 2)) * (my_degree + 1)][2][1]; - grad_grads[i + (j + 2 * (k + 4)) * (my_degree + 1)] + hessians[i + (j + 2 * (k + 4)) * (my_degree + 1)] [2][1][1] - = p2_grad_grads[i + (j + k * (my_degree + 2)) + = p2_hessians[i + (j + k * (my_degree + 2)) * (my_degree + 1)][2][2]; - grad_grads[i + (j + 2 * (k + 4)) * (my_degree + 1)] + hessians[i + (j + 2 * (k + 4)) * (my_degree + 1)] [2][1][2] - = p2_grad_grads[i + (j + k * (my_degree + 2)) + = p2_hessians[i + (j + k * (my_degree + 2)) * (my_degree + 1)][2][0]; - grad_grads[i + (j + 2 * (k + 4)) * (my_degree + 1)] + hessians[i + (j + 2 * (k + 4)) * (my_degree + 1)] [2][2][0] - = p2_grad_grads[i + (j + k * (my_degree + 2)) + = p2_hessians[i + (j + k * (my_degree + 2)) * (my_degree + 1)][0][1]; - grad_grads[i + (j + 2 * (k + 4)) * (my_degree + 1)] + hessians[i + (j + 2 * (k + 4)) * (my_degree + 1)] [2][2][1] - = p2_grad_grads[i + (j + k * (my_degree + 2)) + = p2_hessians[i + (j + k * (my_degree + 2)) * (my_degree + 1)][0][2]; - grad_grads[i + (j + 2 * (k + 4)) * (my_degree + 1)] + hessians[i + (j + 2 * (k + 4)) * (my_degree + 1)] [2][2][2] - = p2_grad_grads[i + (j + k * (my_degree + 2)) + = p2_hessians[i + (j + k * (my_degree + 2)) * (my_degree + 1)][0][0]; } - grad_grads[i + j * (my_degree + 1)][1][0][0] - = p1_grad_grads[i + j * (my_degree + 1) + hessians[i + j * (my_degree + 1)][1][0][0] + = p1_hessians[i + j * (my_degree + 1) * (my_degree + 2)][2][2]; - grad_grads[i + j * (my_degree + 1)][1][0][1] - = p1_grad_grads[i + j * (my_degree + 1) + hessians[i + j * (my_degree + 1)][1][0][1] + = p1_hessians[i + j * (my_degree + 1) * (my_degree + 2)][2][0]; - grad_grads[i + j * (my_degree + 1)][1][0][2] - = p1_grad_grads[i + j * (my_degree + 1) + hessians[i + j * (my_degree + 1)][1][0][2] + = p1_hessians[i + j * (my_degree + 1) * (my_degree + 2)][2][1]; - grad_grads[i + j * (my_degree + 1)][1][1][0] - = p1_grad_grads[i + j * (my_degree + 1) + hessians[i + j * (my_degree + 1)][1][1][0] + = p1_hessians[i + j * (my_degree + 1) * (my_degree + 2)][0][2]; - grad_grads[i + j * (my_degree + 1)][1][1][1] - = p1_grad_grads[i + j * (my_degree + 1) + hessians[i + j * (my_degree + 1)][1][1][1] + = p1_hessians[i + j * (my_degree + 1) * (my_degree + 2)][0][0]; - grad_grads[i + j * (my_degree + 1)][1][1][2] - = p1_grad_grads[i + j * (my_degree + 1) + hessians[i + j * (my_degree + 1)][1][1][2] + = p1_hessians[i + j * (my_degree + 1) * (my_degree + 2)][0][1]; - grad_grads[i + j * (my_degree + 1)][1][2][0] - = p1_grad_grads[i + j * (my_degree + 1) + hessians[i + j * (my_degree + 1)][1][2][0] + = p1_hessians[i + j * (my_degree + 1) * (my_degree + 2)][1][2]; - grad_grads[i + j * (my_degree + 1)][1][2][1] - = p1_grad_grads[i + j * (my_degree + 1) + hessians[i + j * (my_degree + 1)][1][2][1] + = p1_hessians[i + j * (my_degree + 1) * (my_degree + 2)][1][0]; - grad_grads[i + j * (my_degree + 1)][1][2][2] - = p1_grad_grads[i + j * (my_degree + 1) + hessians[i + j * (my_degree + 1)][1][2][2] + = p1_hessians[i + j * (my_degree + 1) * (my_degree + 2)][1][1]; } - grad_grads[i + 4 * (my_degree + 1)][1][0][0] - = p1_grad_grads[i + my_degree + 1][2][2]; - grad_grads[i + 4 * (my_degree + 1)][1][0][1] - = p1_grad_grads[i + my_degree + 1][2][0]; - grad_grads[i + 4 * (my_degree + 1)][1][0][2] - = p1_grad_grads[i + my_degree + 1][2][1]; - grad_grads[i + 4 * (my_degree + 1)][1][1][0] - = p1_grad_grads[i + my_degree + 1][0][2]; - grad_grads[i + 4 * (my_degree + 1)][1][1][1] - = p1_grad_grads[i + my_degree + 1][0][0]; - grad_grads[i + 4 * (my_degree + 1)][1][1][2] - = p1_grad_grads[i + my_degree + 1][0][1]; - grad_grads[i + 4 * (my_degree + 1)][1][2][0] - = p1_grad_grads[i + my_degree + 1][1][2]; - grad_grads[i + 4 * (my_degree + 1)][1][2][1] - = p1_grad_grads[i + my_degree + 1][1][0]; - grad_grads[i + 4 * (my_degree + 1)][1][2][2] - = p1_grad_grads[i + my_degree + 1][1][1]; - grad_grads[i + 5 * (my_degree + 1)][1][0][0] - = p1_grad_grads[i + (my_degree + 1) * (my_degree + 3)][2] + hessians[i + 4 * (my_degree + 1)][1][0][0] + = p1_hessians[i + my_degree + 1][2][2]; + hessians[i + 4 * (my_degree + 1)][1][0][1] + = p1_hessians[i + my_degree + 1][2][0]; + hessians[i + 4 * (my_degree + 1)][1][0][2] + = p1_hessians[i + my_degree + 1][2][1]; + hessians[i + 4 * (my_degree + 1)][1][1][0] + = p1_hessians[i + my_degree + 1][0][2]; + hessians[i + 4 * (my_degree + 1)][1][1][1] + = p1_hessians[i + my_degree + 1][0][0]; + hessians[i + 4 * (my_degree + 1)][1][1][2] + = p1_hessians[i + my_degree + 1][0][1]; + hessians[i + 4 * (my_degree + 1)][1][2][0] + = p1_hessians[i + my_degree + 1][1][2]; + hessians[i + 4 * (my_degree + 1)][1][2][1] + = p1_hessians[i + my_degree + 1][1][0]; + hessians[i + 4 * (my_degree + 1)][1][2][2] + = p1_hessians[i + my_degree + 1][1][1]; + hessians[i + 5 * (my_degree + 1)][1][0][0] + = p1_hessians[i + (my_degree + 1) * (my_degree + 3)][2] [2]; - grad_grads[i + 5 * (my_degree + 1)][1][0][1] - = p1_grad_grads[i + (my_degree + 1) * (my_degree + 3)][2] + hessians[i + 5 * (my_degree + 1)][1][0][1] + = p1_hessians[i + (my_degree + 1) * (my_degree + 3)][2] [0]; - grad_grads[i + 5 * (my_degree + 1)][1][0][2] - = p1_grad_grads[i + (my_degree + 1) * (my_degree + 3)][2] + hessians[i + 5 * (my_degree + 1)][1][0][2] + = p1_hessians[i + (my_degree + 1) * (my_degree + 3)][2] [1]; - grad_grads[i + 5 * (my_degree + 1)][1][1][0] - = p1_grad_grads[i + (my_degree + 1) * (my_degree + 3)][0] + hessians[i + 5 * (my_degree + 1)][1][1][0] + = p1_hessians[i + (my_degree + 1) * (my_degree + 3)][0] [2]; - grad_grads[i + 5 * (my_degree + 1)][1][1][1] - = p1_grad_grads[i + (my_degree + 1) * (my_degree + 3)][0] + hessians[i + 5 * (my_degree + 1)][1][1][1] + = p1_hessians[i + (my_degree + 1) * (my_degree + 3)][0] [0]; - grad_grads[i + 5 * (my_degree + 1)][1][1][2] - = p1_grad_grads[i + (my_degree + 1) * (my_degree + 3)][0] + hessians[i + 5 * (my_degree + 1)][1][1][2] + = p1_hessians[i + (my_degree + 1) * (my_degree + 3)][0] [1]; - grad_grads[i + 5 * (my_degree + 1)][1][2][0] - = p1_grad_grads[i + (my_degree + 1) * (my_degree + 3)][1] + hessians[i + 5 * (my_degree + 1)][1][2][0] + = p1_hessians[i + (my_degree + 1) * (my_degree + 3)][1] [2]; - grad_grads[i + 5 * (my_degree + 1)][1][2][1] - = p1_grad_grads[i + (my_degree + 1) * (my_degree + 3)][1] + hessians[i + 5 * (my_degree + 1)][1][2][1] + = p1_hessians[i + (my_degree + 1) * (my_degree + 3)][1] [0]; - grad_grads[i + 5 * (my_degree + 1)][1][2][2] - = p1_grad_grads[i + (my_degree + 1) * (my_degree + 3)][1] + hessians[i + 5 * (my_degree + 1)][1][2][2] + = p1_hessians[i + (my_degree + 1) * (my_degree + 3)][1] [1]; } @@ -876,7 +876,7 @@ const { for (unsigned int n = 0; n < 2; ++n) { - grad_grads[((i + 2 + hessians[((i + 2 * GeometryInfo::faces_per_cell) * my_degree + j + GeometryInfo::lines_per_cell @@ -885,7 +885,7 @@ const * my_degree + k + GeometryInfo::lines_per_cell] [n + 1][l][m] = 0.0; - grad_grads[(i + (j + 2 + hessians[(i + (j + 2 * GeometryInfo::faces_per_cell + my_degree) * (my_degree + 1) @@ -893,7 +893,7 @@ const * my_degree + k + GeometryInfo::lines_per_cell] [2 * n][l][m] = 0.0; - grad_grads[i + (j + (k + 2 + hessians[i + (j + (k + 2 * (GeometryInfo::faces_per_cell + my_degree)) * my_degree @@ -902,7 +902,7 @@ const = 0.0; } - grad_grads[((i + 2 + hessians[((i + 2 * GeometryInfo::faces_per_cell) * my_degree + j + GeometryInfo::lines_per_cell @@ -911,13 +911,13 @@ const * my_degree + k + GeometryInfo::lines_per_cell] [0][l][m] - = unit_point_grad_grads[i + (j + (k + 2) + = unit_point_hessians[i + (j + (k + 2) * (my_degree + 2) + 2) * (my_degree + 1)][l][m]; } - grad_grads[(i + (j + 2 + hessians[(i + (j + 2 * GeometryInfo::faces_per_cell + my_degree) * (my_degree + 1) @@ -925,144 +925,144 @@ const * my_degree + k + GeometryInfo::lines_per_cell][1][0] [0] - = p1_grad_grads[i + ((j + 2) * (my_degree + 2) + k + = p1_hessians[i + ((j + 2) * (my_degree + 2) + k + 2) * (my_degree + 1)][2][2]; - grad_grads[(i + (j + 2 + hessians[(i + (j + 2 * GeometryInfo::faces_per_cell + my_degree) * (my_degree + 1) + GeometryInfo::lines_per_cell) * my_degree + k + GeometryInfo::lines_per_cell][1][0] [1] - = p1_grad_grads[i + ((j + 2) * (my_degree + 2) + k + = p1_hessians[i + ((j + 2) * (my_degree + 2) + k + 2) * (my_degree + 1)][2][0]; - grad_grads[(i + (j + 2 + hessians[(i + (j + 2 * GeometryInfo::faces_per_cell + my_degree) * (my_degree + 1) + GeometryInfo::lines_per_cell) * my_degree + k + GeometryInfo::lines_per_cell][1][0] [2] - = p1_grad_grads[i + ((j + 2) * (my_degree + 2) + k + = p1_hessians[i + ((j + 2) * (my_degree + 2) + k + 2) * (my_degree + 1)][2][1]; - grad_grads[(i + (j + 2 + hessians[(i + (j + 2 * GeometryInfo::faces_per_cell + my_degree) * (my_degree + 1) + GeometryInfo::lines_per_cell) * my_degree + k + GeometryInfo::lines_per_cell][1][1] [0] - = p1_grad_grads[i + ((j + 2) * (my_degree + 2) + k + = p1_hessians[i + ((j + 2) * (my_degree + 2) + k + 2) * (my_degree + 1)][0][2]; - grad_grads[(i + (j + 2 + hessians[(i + (j + 2 * GeometryInfo::faces_per_cell + my_degree) * (my_degree + 1) + GeometryInfo::lines_per_cell) * my_degree + k + GeometryInfo::lines_per_cell][1][1] [1] - = p1_grad_grads[i + ((j + 2) * (my_degree + 2) + k + = p1_hessians[i + ((j + 2) * (my_degree + 2) + k + 2) * (my_degree + 1)][0][0]; - grad_grads[(i + (j + 2 + hessians[(i + (j + 2 * GeometryInfo::faces_per_cell + my_degree) * (my_degree + 1) + GeometryInfo::lines_per_cell) * my_degree + k + GeometryInfo::lines_per_cell][1][1] [2] - = p1_grad_grads[i + ((j + 2) * (my_degree + 2) + k + = p1_hessians[i + ((j + 2) * (my_degree + 2) + k + 2) * (my_degree + 1)][0][1]; - grad_grads[(i + (j + 2 + hessians[(i + (j + 2 * GeometryInfo::faces_per_cell + my_degree) * (my_degree + 1) + GeometryInfo::lines_per_cell) * my_degree + k + GeometryInfo::lines_per_cell][1][2] [0] - = p1_grad_grads[i + ((j + 2) * (my_degree + 2) + k + = p1_hessians[i + ((j + 2) * (my_degree + 2) + k + 2) * (my_degree + 1)][1][2]; - grad_grads[(i + (j + 2 + hessians[(i + (j + 2 * GeometryInfo::faces_per_cell + my_degree) * (my_degree + 1) + GeometryInfo::lines_per_cell) * my_degree + k + GeometryInfo::lines_per_cell][1][2] [1] - = p1_grad_grads[i + ((j + 2) * (my_degree + 2) + k + = p1_hessians[i + ((j + 2) * (my_degree + 2) + k + 2) * (my_degree + 1)][1][0]; - grad_grads[(i + (j + 2 + hessians[(i + (j + 2 * GeometryInfo::faces_per_cell + my_degree) * (my_degree + 1) + GeometryInfo::lines_per_cell) * my_degree + k + GeometryInfo::lines_per_cell][1][2] [2] - = p1_grad_grads[i + ((j + 2) * (my_degree + 2) + k + = p1_hessians[i + ((j + 2) * (my_degree + 2) + k + 2) * (my_degree + 1)][1][1]; - grad_grads[i + (j + (k + 2 + hessians[i + (j + (k + 2 * (GeometryInfo::faces_per_cell + my_degree)) * my_degree + GeometryInfo::lines_per_cell) * (my_degree + 1)][2][0][0] - = p2_grad_grads[i + (j + (k + 2) * (my_degree + 2) + = p2_hessians[i + (j + (k + 2) * (my_degree + 2) + 2) * (my_degree + 1)][1][1]; - grad_grads[i + (j + (k + 2 + hessians[i + (j + (k + 2 * (GeometryInfo::faces_per_cell + my_degree)) * my_degree + GeometryInfo::lines_per_cell) * (my_degree + 1)][2][0][1] - = p2_grad_grads[i + (j + (k + 2) * (my_degree + 2) + = p2_hessians[i + (j + (k + 2) * (my_degree + 2) + 2) * (my_degree + 1)][1][2]; - grad_grads[i + (j + (k + 2 + hessians[i + (j + (k + 2 * (GeometryInfo::faces_per_cell + my_degree)) * my_degree + GeometryInfo::lines_per_cell) * (my_degree + 1)][2][0][2] - = p2_grad_grads[i + (j + (k + 2) * (my_degree + 2) + = p2_hessians[i + (j + (k + 2) * (my_degree + 2) + 2) * (my_degree + 1)][1][0]; - grad_grads[i + (j + (k + 2 + hessians[i + (j + (k + 2 * (GeometryInfo::faces_per_cell + my_degree)) * my_degree + GeometryInfo::lines_per_cell) * (my_degree + 1)][2][1][0] - = p2_grad_grads[i + (j + (k + 2) * (my_degree + 2) + = p2_hessians[i + (j + (k + 2) * (my_degree + 2) + 2) * (my_degree + 1)][2][1]; - grad_grads[i + (j + (k + 2 + hessians[i + (j + (k + 2 * (GeometryInfo::faces_per_cell + my_degree)) * my_degree + GeometryInfo::lines_per_cell) * (my_degree + 1)][2][1][1] - = p2_grad_grads[i + (j + (k + 2) * (my_degree + 2) + = p2_hessians[i + (j + (k + 2) * (my_degree + 2) + 2) * (my_degree + 1)][2][2]; - grad_grads[i + (j + (k + 2 + hessians[i + (j + (k + 2 * (GeometryInfo::faces_per_cell + my_degree)) * my_degree + GeometryInfo::lines_per_cell) * (my_degree + 1)][2][1][2] - = p2_grad_grads[i + (j + (k + 2) * (my_degree + 2) + = p2_hessians[i + (j + (k + 2) * (my_degree + 2) + 2) * (my_degree + 1)][2][0]; - grad_grads[i + (j + (k + 2 + hessians[i + (j + (k + 2 * (GeometryInfo::faces_per_cell + my_degree)) * my_degree + GeometryInfo::lines_per_cell) * (my_degree + 1)][2][2][0] - = p2_grad_grads[i + (j + (k + 2) * (my_degree + 2) + = p2_hessians[i + (j + (k + 2) * (my_degree + 2) + 2) * (my_degree + 1)][0][1]; - grad_grads[i + (j + (k + 2 + hessians[i + (j + (k + 2 * (GeometryInfo::faces_per_cell + my_degree)) * my_degree + GeometryInfo::lines_per_cell) * (my_degree + 1)][2][2][1] - = p2_grad_grads[i + (j + (k + 2) * (my_degree + 2) + = p2_hessians[i + (j + (k + 2) * (my_degree + 2) + 2) * (my_degree + 1)][0][2]; - grad_grads[i + (j + (k + 2 + hessians[i + (j + (k + 2 * (GeometryInfo::faces_per_cell + my_degree)) * my_degree + GeometryInfo::lines_per_cell) * (my_degree + 1)][2][2][2] - = p2_grad_grads[i + (j + (k + 2) * (my_degree + 2) + = p2_hessians[i + (j + (k + 2) * (my_degree + 2) + 2) * (my_degree + 1)][0][0]; } @@ -1075,12 +1075,12 @@ const { for (unsigned int o = 0; o < 2; ++o) { - grad_grads[i + (j + (2 * (k + 2 * n) + hessians[i + (j + (2 * (k + 2 * n) + 1) * my_degree + GeometryInfo::lines_per_cell) * (my_degree + 1)][o + n][l][m] = 0.0; - grad_grads[(i + 2 * (k + 2 * (n + 1)) + hessians[(i + 2 * (k + 2 * (n + 1)) * (my_degree + 1) + GeometryInfo::lines_per_cell) * my_degree + j @@ -1088,245 +1088,245 @@ const [o + k][l][m] = 0.0; } - grad_grads[(i + 2 * k * (my_degree + 1) + hessians[(i + 2 * k * (my_degree + 1) + GeometryInfo::lines_per_cell) * my_degree + j + GeometryInfo::lines_per_cell] [2 * n][l][m] = 0.0; - grad_grads[i + (j + (2 * k + 9) + hessians[i + (j + (2 * k + 9) * my_degree + GeometryInfo::lines_per_cell) * (my_degree + 1)][2 * n][l][m] = 0.0; } - grad_grads[i + (j + (2 * k + 5) * my_degree + hessians[i + (j + (2 * k + 5) * my_degree + GeometryInfo::lines_per_cell) * (my_degree + 1)] [0][l][m] - = unit_point_grad_grads[i + ((j + 2) + = unit_point_hessians[i + ((j + 2) * (my_degree + 2) + k) * (my_degree + 1)][l] [m]; - grad_grads[(i + 2 * (k + 4) * (my_degree + 1) + hessians[(i + 2 * (k + 4) * (my_degree + 1) + GeometryInfo::lines_per_cell) * my_degree + j + GeometryInfo::lines_per_cell] [0][l][m] - = unit_point_grad_grads[i + (j + k + = unit_point_hessians[i + (j + k * (my_degree + 2) + 2) * (my_degree + 1)][l] [m]; } - grad_grads[(i + 2 * k * (my_degree + 1) + hessians[(i + 2 * k * (my_degree + 1) + GeometryInfo::lines_per_cell) * my_degree + j + GeometryInfo::lines_per_cell][1][0] [0] - = p1_grad_grads[i + (j + k * (my_degree + 2) + 2) + = p1_hessians[i + (j + k * (my_degree + 2) + 2) * (my_degree + 1)][2][2]; - grad_grads[(i + 2 * k * (my_degree + 1) + hessians[(i + 2 * k * (my_degree + 1) + GeometryInfo::lines_per_cell) * my_degree + j + GeometryInfo::lines_per_cell][1][0] [1] - = p1_grad_grads[i + (j + k * (my_degree + 2) + 2) + = p1_hessians[i + (j + k * (my_degree + 2) + 2) * (my_degree + 1)][2][0]; - grad_grads[(i + 2 * k * (my_degree + 1) + hessians[(i + 2 * k * (my_degree + 1) + GeometryInfo::lines_per_cell) * my_degree + j + GeometryInfo::lines_per_cell][1][0] [2] - = p1_grad_grads[i + (j + k * (my_degree + 2) + 2) + = p1_hessians[i + (j + k * (my_degree + 2) + 2) * (my_degree + 1)][2][1]; - grad_grads[(i + 2 * k * (my_degree + 1) + hessians[(i + 2 * k * (my_degree + 1) + GeometryInfo::lines_per_cell) * my_degree + j + GeometryInfo::lines_per_cell][1][1] [0] - = p1_grad_grads[i + (j + k * (my_degree + 2) + 2) + = p1_hessians[i + (j + k * (my_degree + 2) + 2) * (my_degree + 1)][0][2]; - grad_grads[(i + 2 * k * (my_degree + 1) + hessians[(i + 2 * k * (my_degree + 1) + GeometryInfo::lines_per_cell) * my_degree + j + GeometryInfo::lines_per_cell][1][1] [1] - = p1_grad_grads[i + (j + k * (my_degree + 2) + 2) + = p1_hessians[i + (j + k * (my_degree + 2) + 2) * (my_degree + 1)][0][0]; - grad_grads[(i + 2 * k * (my_degree + 1) + hessians[(i + 2 * k * (my_degree + 1) + GeometryInfo::lines_per_cell) * my_degree + j + GeometryInfo::lines_per_cell][1][1] [2] - = p1_grad_grads[i + (j + k * (my_degree + 2) + 2) + = p1_hessians[i + (j + k * (my_degree + 2) + 2) * (my_degree + 1)][0][1]; - grad_grads[(i + 2 * k * (my_degree + 1) + hessians[(i + 2 * k * (my_degree + 1) + GeometryInfo::lines_per_cell) * my_degree + j + GeometryInfo::lines_per_cell][1][2] [0] - = p1_grad_grads[i + (j + k * (my_degree + 2) + 2) + = p1_hessians[i + (j + k * (my_degree + 2) + 2) * (my_degree + 1)][1][2]; - grad_grads[(i + 2 * k * (my_degree + 1) + hessians[(i + 2 * k * (my_degree + 1) + GeometryInfo::lines_per_cell) * my_degree + j + GeometryInfo::lines_per_cell][1][2] [1] - = p1_grad_grads[i + (j + k * (my_degree + 2) + 2) + = p1_hessians[i + (j + k * (my_degree + 2) + 2) * (my_degree + 1)][1][0]; - grad_grads[(i + 2 * k * (my_degree + 1) + hessians[(i + 2 * k * (my_degree + 1) + GeometryInfo::lines_per_cell) * my_degree + j + GeometryInfo::lines_per_cell][1][2] [2] - = p1_grad_grads[i + (j + k * (my_degree + 2) + 2) + = p1_hessians[i + (j + k * (my_degree + 2) + 2) * (my_degree + 1)][1][1]; - grad_grads[i + (j + (2 * k + 1) * my_degree + hessians[i + (j + (2 * k + 1) * my_degree + GeometryInfo::lines_per_cell) * (my_degree + 1)][2][0][0] - = p2_grad_grads[i + ((j + 2) * (my_degree + 2) + k) + = p2_hessians[i + ((j + 2) * (my_degree + 2) + k) * (my_degree + 1)][1][1]; - grad_grads[i + (j + (2 * k + 1) * my_degree + hessians[i + (j + (2 * k + 1) * my_degree + GeometryInfo::lines_per_cell) * (my_degree + 1)][2][0][1] - = p2_grad_grads[i + ((j + 2) * (my_degree + 2) + k) + = p2_hessians[i + ((j + 2) * (my_degree + 2) + k) * (my_degree + 1)][1][2]; - grad_grads[i + (j + (2 * k + 1) * my_degree + hessians[i + (j + (2 * k + 1) * my_degree + GeometryInfo::lines_per_cell) * (my_degree + 1)][2][0][2] - = p2_grad_grads[i + ((j + 2) * (my_degree + 2) + k) + = p2_hessians[i + ((j + 2) * (my_degree + 2) + k) * (my_degree + 1)][1][0]; - grad_grads[i + (j + (2 * k + 1) * my_degree + hessians[i + (j + (2 * k + 1) * my_degree + GeometryInfo::lines_per_cell) * (my_degree + 1)][2][1][0] - = p2_grad_grads[i + ((j + 2) * (my_degree + 2) + k) + = p2_hessians[i + ((j + 2) * (my_degree + 2) + k) * (my_degree + 1)][2][1]; - grad_grads[i + (j + (2 * k + 1) * my_degree + hessians[i + (j + (2 * k + 1) * my_degree + GeometryInfo::lines_per_cell) * (my_degree + 1)][2][1][1] - = p2_grad_grads[i + ((j + 2) * (my_degree + 2) + k) + = p2_hessians[i + ((j + 2) * (my_degree + 2) + k) * (my_degree + 1)][2][2]; - grad_grads[i + (j + (2 * k + 1) * my_degree + hessians[i + (j + (2 * k + 1) * my_degree + GeometryInfo::lines_per_cell) * (my_degree + 1)][2][1][2] - = p2_grad_grads[i + ((j + 2) * (my_degree + 2) + k) + = p2_hessians[i + ((j + 2) * (my_degree + 2) + k) * (my_degree + 1)][2][0]; - grad_grads[i + (j + (2 * k + 1) * my_degree + hessians[i + (j + (2 * k + 1) * my_degree + GeometryInfo::lines_per_cell) * (my_degree + 1)][2][2][0] - = p2_grad_grads[i + ((j + 2) * (my_degree + 2) + k) + = p2_hessians[i + ((j + 2) * (my_degree + 2) + k) * (my_degree + 1)][0][1]; - grad_grads[i + (j + (2 * k + 1) * my_degree + hessians[i + (j + (2 * k + 1) * my_degree + GeometryInfo::lines_per_cell) * (my_degree + 1)][2][2][1] - = p2_grad_grads[i + ((j + 2) * (my_degree + 2) + k) + = p2_hessians[i + ((j + 2) * (my_degree + 2) + k) * (my_degree + 1)][0][2]; - grad_grads[i + (j + (2 * k + 1) * my_degree + hessians[i + (j + (2 * k + 1) * my_degree + GeometryInfo::lines_per_cell) * (my_degree + 1)][2][2][2] - = p2_grad_grads[i + ((j + 2) * (my_degree + 2) + k) + = p2_hessians[i + ((j + 2) * (my_degree + 2) + k) * (my_degree + 1)][0][0]; - grad_grads[(i + 2 * (k + 2) * (my_degree + 1) + hessians[(i + 2 * (k + 2) * (my_degree + 1) + GeometryInfo::lines_per_cell) * my_degree + j + GeometryInfo::lines_per_cell][2][0][0] - = p2_grad_grads[i + (j + k * (my_degree + 2) + 2) + = p2_hessians[i + (j + k * (my_degree + 2) + 2) * (my_degree + 1)][1][1]; - grad_grads[(i + 2 * (k + 2) * (my_degree + 1) + hessians[(i + 2 * (k + 2) * (my_degree + 1) + GeometryInfo::lines_per_cell) * my_degree + j + GeometryInfo::lines_per_cell][2][0][1] - = p2_grad_grads[i + (j + k * (my_degree + 2) + 2) + = p2_hessians[i + (j + k * (my_degree + 2) + 2) * (my_degree + 1)][1][2]; - grad_grads[(i + 2 * (k + 2) * (my_degree + 1) + hessians[(i + 2 * (k + 2) * (my_degree + 1) + GeometryInfo::lines_per_cell) * my_degree + j + GeometryInfo::lines_per_cell][2][0][2] - = p2_grad_grads[i + (j + k * (my_degree + 2) + 2) + = p2_hessians[i + (j + k * (my_degree + 2) + 2) * (my_degree + 1)][1][0]; - grad_grads[(i + 2 * (k + 2) * (my_degree + 1) + hessians[(i + 2 * (k + 2) * (my_degree + 1) + GeometryInfo::lines_per_cell) * my_degree + j + GeometryInfo::lines_per_cell][2][1][0] - = p2_grad_grads[i + (j + k * (my_degree + 2) + 2) + = p2_hessians[i + (j + k * (my_degree + 2) + 2) * (my_degree + 1)][2][1]; - grad_grads[(i + 2 * (k + 2) * (my_degree + 1) + hessians[(i + 2 * (k + 2) * (my_degree + 1) + GeometryInfo::lines_per_cell) * my_degree + j + GeometryInfo::lines_per_cell][2][1][1] - = p2_grad_grads[i + (j + k * (my_degree + 2) + 2) + = p2_hessians[i + (j + k * (my_degree + 2) + 2) * (my_degree + 1)][2][2]; - grad_grads[(i + 2 * (k + 2) * (my_degree + 1) + hessians[(i + 2 * (k + 2) * (my_degree + 1) + GeometryInfo::lines_per_cell) * my_degree + j + GeometryInfo::lines_per_cell][2][1][2] - = p2_grad_grads[i + (j + k * (my_degree + 2) + 2) + = p2_hessians[i + (j + k * (my_degree + 2) + 2) * (my_degree + 1)][2][0]; - grad_grads[(i + 2 * (k + 2) * (my_degree + 1) + hessians[(i + 2 * (k + 2) * (my_degree + 1) + GeometryInfo::lines_per_cell) * my_degree + j + GeometryInfo::lines_per_cell][2][2][0] - = p2_grad_grads[i + (j + k * (my_degree + 2) + 2) + = p2_hessians[i + (j + k * (my_degree + 2) + 2) * (my_degree + 1)][0][1]; - grad_grads[(i + 2 * (k + 2) * (my_degree + 1) + hessians[(i + 2 * (k + 2) * (my_degree + 1) + GeometryInfo::lines_per_cell) * my_degree + j + GeometryInfo::lines_per_cell][2][2][1] - = p2_grad_grads[i + (j + k * (my_degree + 2) + 2) + = p2_hessians[i + (j + k * (my_degree + 2) + 2) * (my_degree + 1)][0][2]; - grad_grads[(i + 2 * (k + 2) * (my_degree + 1) + hessians[(i + 2 * (k + 2) * (my_degree + 1) + GeometryInfo::lines_per_cell) * my_degree + j + GeometryInfo::lines_per_cell][2][2][2] - = p2_grad_grads[i + (j + k * (my_degree + 2) + 2) + = p2_hessians[i + (j + k * (my_degree + 2) + 2) * (my_degree + 1)][0][0]; - grad_grads[i + (j + (2 * k + 9) * my_degree + hessians[i + (j + (2 * k + 9) * my_degree + GeometryInfo::lines_per_cell) * (my_degree + 1)][1][0][0] - = p1_grad_grads[i + ((j + 2) * (my_degree + 2) + k) + = p1_hessians[i + ((j + 2) * (my_degree + 2) + k) * (my_degree + 1)][2][2]; - grad_grads[i + (j + (2 * k + 9) * my_degree + hessians[i + (j + (2 * k + 9) * my_degree + GeometryInfo::lines_per_cell) * (my_degree + 1)][1][0][1] - = p1_grad_grads[i + ((j + 2) * (my_degree + 2) + k) + = p1_hessians[i + ((j + 2) * (my_degree + 2) + k) * (my_degree + 1)][2][0]; - grad_grads[i + (j + (2 * k + 9) * my_degree + hessians[i + (j + (2 * k + 9) * my_degree + GeometryInfo::lines_per_cell) * (my_degree + 1)][1][0][2] - = p1_grad_grads[i + ((j + 2) * (my_degree + 2) + k) + = p1_hessians[i + ((j + 2) * (my_degree + 2) + k) * (my_degree + 1)][2][1]; - grad_grads[i + (j + (2 * k + 9) * my_degree + hessians[i + (j + (2 * k + 9) * my_degree + GeometryInfo::lines_per_cell) * (my_degree + 1)][1][1][0] - = p1_grad_grads[i + ((j + 2) * (my_degree + 2) + k) + = p1_hessians[i + ((j + 2) * (my_degree + 2) + k) * (my_degree + 1)][0][2]; - grad_grads[i + (j + (2 * k + 9) * my_degree + hessians[i + (j + (2 * k + 9) * my_degree + GeometryInfo::lines_per_cell) * (my_degree + 1)][1][1][1] - = p1_grad_grads[i + ((j + 2) * (my_degree + 2) + k) + = p1_hessians[i + ((j + 2) * (my_degree + 2) + k) * (my_degree + 1)][0][0]; - grad_grads[i + (j + (2 * k + 9) * my_degree + hessians[i + (j + (2 * k + 9) * my_degree + GeometryInfo::lines_per_cell) * (my_degree + 1)][1][1][2] - = p1_grad_grads[i + ((j + 2) * (my_degree + 2) + k) + = p1_hessians[i + ((j + 2) * (my_degree + 2) + k) * (my_degree + 1)][0][1]; - grad_grads[i + (j + (2 * k + 9) * my_degree + hessians[i + (j + (2 * k + 9) * my_degree + GeometryInfo::lines_per_cell) * (my_degree + 1)][1][2][0] - = p1_grad_grads[i + ((j + 2) * (my_degree + 2) + k) + = p1_hessians[i + ((j + 2) * (my_degree + 2) + k) * (my_degree + 1)][1][2]; - grad_grads[i + (j + (2 * k + 9) * my_degree + hessians[i + (j + (2 * k + 9) * my_degree + GeometryInfo::lines_per_cell) * (my_degree + 1)][1][2][1] - = p1_grad_grads[i + ((j + 2) * (my_degree + 2) + k) + = p1_hessians[i + ((j + 2) * (my_degree + 2) + k) * (my_degree + 1)][1][0]; - grad_grads[i + (j + (2 * k + 9) * my_degree + hessians[i + (j + (2 * k + 9) * my_degree + GeometryInfo::lines_per_cell) * (my_degree + 1)][1][2][2] - = p1_grad_grads[i + ((j + 2) * (my_degree + 2) + k) + = p1_hessians[i + ((j + 2) * (my_degree + 2) + k) * (my_degree + 1)][1][1]; } } diff --git a/deal.II/source/base/polynomials_raviart_thomas.cc b/deal.II/source/base/polynomials_raviart_thomas.cc index f9c7e0f7c0..408863fb26 100644 --- a/deal.II/source/base/polynomials_raviart_thomas.cc +++ b/deal.II/source/base/polynomials_raviart_thomas.cc @@ -56,14 +56,14 @@ void PolynomialsRaviartThomas::compute (const Point &unit_point, std::vector > &values, std::vector > &grads, - std::vector > &grad_grads) const + std::vector > &hessians) const { Assert(values.size()==n_pols || values.size()==0, ExcDimensionMismatch(values.size(), n_pols)); Assert(grads.size()==n_pols|| grads.size()==0, ExcDimensionMismatch(grads.size(), n_pols)); - Assert(grad_grads.size()==n_pols|| grad_grads.size()==0, - ExcDimensionMismatch(grad_grads.size(), n_pols)); + Assert(hessians.size()==n_pols|| hessians.size()==0, + ExcDimensionMismatch(hessians.size(), n_pols)); // have a few scratch // arrays. because we don't want to @@ -83,12 +83,12 @@ PolynomialsRaviartThomas::compute (const Point &unit_point, static std::vector p_values; static std::vector > p_grads; - static std::vector > p_grad_grads; + static std::vector > p_hessians; const unsigned int n_sub = polynomial_space.n(); p_values.resize((values.size() == 0) ? 0 : n_sub); p_grads.resize((grads.size() == 0) ? 0 : n_sub); - p_grad_grads.resize((grad_grads.size() == 0) ? 0 : n_sub); + p_hessians.resize((hessians.size() == 0) ? 0 : n_sub); for (unsigned int d=0;d::compute (const Point &unit_point, for (unsigned int c=0;c::compute (const Point &unit_point, for (unsigned int d1=0;d1::compute_grad (const unsigned int i, template Tensor<2,dim> -TensorProductPolynomials::compute_grad_grad (const unsigned int i, +TensorProductPolynomials::compute_hessian (const unsigned int i, const Point &p) const { unsigned int indices[dim]; @@ -184,11 +184,11 @@ TensorProductPolynomials::compute_grad_grad (const unsigned int i, } } - Tensor<2,dim> grad_grad; + Tensor<2,dim> hessian; for (unsigned int d1=0; d1::compute_grad_grad (const unsigned int i, else derivative=1; } - grad_grad[d1][d2] *= v[x][derivative]; + hessian[d1][d2] *= v[x][derivative]; } } - return grad_grad; + return hessian; } @@ -215,18 +215,18 @@ TensorProductPolynomials:: compute (const Point &p, std::vector &values, std::vector > &grads, - std::vector > &grad_grads) const + std::vector > &hessians) const { Assert (values.size()==n_tensor_pols || values.size()==0, ExcDimensionMismatch2(values.size(), n_tensor_pols, 0)); Assert (grads.size()==n_tensor_pols || grads.size()==0, ExcDimensionMismatch2(grads.size(), n_tensor_pols, 0)); - Assert (grad_grads.size()==n_tensor_pols|| grad_grads.size()==0, - ExcDimensionMismatch2(grad_grads.size(), n_tensor_pols, 0)); + Assert (hessians.size()==n_tensor_pols|| hessians.size()==0, + ExcDimensionMismatch2(hessians.size(), n_tensor_pols, 0)); const bool update_values = (values.size() == n_tensor_pols), update_grads = (grads.size()==n_tensor_pols), - update_grad_grads = (grad_grads.size()==n_tensor_pols); + update_hessians = (hessians.size()==n_tensor_pols); // check how many // values/derivatives we have to @@ -236,7 +236,7 @@ compute (const Point &p, n_values_and_derivatives = 1; if (update_grads) n_values_and_derivatives = 2; - if (update_grad_grads) + if (update_hessians) n_values_and_derivatives = 3; @@ -284,11 +284,11 @@ compute (const Point &p, grads[i][d] *= v(x,indices[x])[d==x]; } - if (update_grad_grads) + if (update_hessians) for (unsigned int d1=0; d1 &p, else derivative=1; } - grad_grads[i][d1][d2] + hessians[i][d1][d2] *= v(x,indices[x])[derivative]; } } @@ -436,7 +436,7 @@ AnisotropicPolynomials::compute_grad (const unsigned int i, template Tensor<2,dim> -AnisotropicPolynomials::compute_grad_grad (const unsigned int i, +AnisotropicPolynomials::compute_hessian (const unsigned int i, const Point &p) const { unsigned int indices[dim]; @@ -446,11 +446,11 @@ AnisotropicPolynomials::compute_grad_grad (const unsigned int i, for (unsigned int d=0; d grad_grad; + Tensor<2,dim> hessian; for (unsigned int d1=0; d1::compute_grad_grad (const unsigned int i, else derivative=1; } - grad_grad[d1][d2] *= v[x][derivative]; + hessian[d1][d2] *= v[x][derivative]; } } - return grad_grad; + return hessian; } @@ -477,18 +477,18 @@ AnisotropicPolynomials:: compute (const Point &p, std::vector &values, std::vector > &grads, - std::vector > &grad_grads) const + std::vector > &hessians) const { Assert (values.size()==n_tensor_pols || values.size()==0, ExcDimensionMismatch2(values.size(), n_tensor_pols, 0)); Assert (grads.size()==n_tensor_pols|| grads.size()==0, ExcDimensionMismatch2(grads.size(), n_tensor_pols, 0)); - Assert (grad_grads.size()==n_tensor_pols|| grad_grads.size()==0, - ExcDimensionMismatch2(grad_grads.size(), n_tensor_pols, 0)); + Assert (hessians.size()==n_tensor_pols|| hessians.size()==0, + ExcDimensionMismatch2(hessians.size(), n_tensor_pols, 0)); const bool update_values = (values.size() == n_tensor_pols), update_grads = (grads.size()==n_tensor_pols), - update_grad_grads = (grad_grads.size()==n_tensor_pols); + update_hessians = (hessians.size()==n_tensor_pols); // check how many // values/derivatives we have to @@ -498,7 +498,7 @@ compute (const Point &p, n_values_and_derivatives = 1; if (update_grads) n_values_and_derivatives = 2; - if (update_grad_grads) + if (update_hessians) n_values_and_derivatives = 3; @@ -541,11 +541,11 @@ compute (const Point &p, grads[i][d] *= v[x][indices[x]][d==x ? 1 : 0]; } - if (update_grad_grads) + if (update_hessians) for (unsigned int d1=0; d1 &p, else derivative=1; } - grad_grads[i][d1][d2] + hessians[i][d1][d2] *= v[x][indices[x]][derivative]; } } diff --git a/deal.II/source/fe/fe.cc b/deal.II/source/fe/fe.cc index 8a5811c4f0..4915211f5a 100644 --- a/deal.II/source/fe/fe.cc +++ b/deal.II/source/fe/fe.cc @@ -283,7 +283,7 @@ FiniteElement::shape_grad_component (const unsigned int, template Tensor<2,dim> -FiniteElement::shape_grad_grad (const unsigned int, +FiniteElement::shape_hessian (const unsigned int, const Point &) const { AssertThrow(false, ExcUnitShapeValuesDoNotExist()); @@ -294,7 +294,7 @@ FiniteElement::shape_grad_grad (const unsigned int, template Tensor<2,dim> -FiniteElement::shape_grad_grad_component (const unsigned int, +FiniteElement::shape_hessian_component (const unsigned int, const Point &, const unsigned int) const { diff --git a/deal.II/source/fe/fe_dgp_nonparametric.cc b/deal.II/source/fe/fe_dgp_nonparametric.cc index 850c57e586..5877049385 100644 --- a/deal.II/source/fe/fe_dgp_nonparametric.cc +++ b/deal.II/source/fe/fe_dgp_nonparametric.cc @@ -167,24 +167,24 @@ FE_DGPNonparametric::shape_grad_component (const unsigned int i, template Tensor<2,dim> -FE_DGPNonparametric::shape_grad_grad (const unsigned int i, +FE_DGPNonparametric::shape_hessian (const unsigned int i, const Point &p) const { Assert (idofs_per_cell, ExcIndexRange(i, 0, this->dofs_per_cell)); - return polynomial_space.compute_grad_grad(i, p); + return polynomial_space.compute_hessian(i, p); } template Tensor<2,dim> -FE_DGPNonparametric::shape_grad_grad_component (const unsigned int i, +FE_DGPNonparametric::shape_hessian_component (const unsigned int i, const Point &p, const unsigned int component) const { Assert (idofs_per_cell, ExcIndexRange(i, 0, this->dofs_per_cell)); Assert (component == 0, ExcIndexRange (component, 0, 1)); - return polynomial_space.compute_grad_grad(i, p); + return polynomial_space.compute_hessian(i, p); } @@ -272,7 +272,7 @@ FE_DGPNonparametric::get_data ( if (flags & update_hessians) { - data->grad_grads.resize (this->dofs_per_cell); + data->hessians.resize (this->dofs_per_cell); } return data; } @@ -311,7 +311,7 @@ FE_DGPNonparametric::fill_fe_values ( for (unsigned int i=0; idofs_per_cell; ++k) { if (flags & update_values) @@ -319,7 +319,7 @@ FE_DGPNonparametric::fill_fe_values ( if (flags & update_gradients) data.shape_gradients[k][i] = fe_data.grads[k]; if (flags & update_hessians) - data.shape_hessians[k][i] = fe_data.grad_grads[k]; + data.shape_hessians[k][i] = fe_data.hessians[k]; } } } @@ -354,7 +354,7 @@ FE_DGPNonparametric::fill_fe_face_values ( for (unsigned int i=0; idofs_per_cell; ++k) { if (flags & update_values) @@ -362,7 +362,7 @@ FE_DGPNonparametric::fill_fe_face_values ( if (flags & update_gradients) data.shape_gradients[k][i] = fe_data.grads[k]; if (flags & update_hessians) - data.shape_hessians[k][i] = fe_data.grad_grads[k]; + data.shape_hessians[k][i] = fe_data.hessians[k]; } } } @@ -398,7 +398,7 @@ FE_DGPNonparametric::fill_fe_subface_values ( for (unsigned int i=0; idofs_per_cell; ++k) { if (flags & update_values) @@ -406,7 +406,7 @@ FE_DGPNonparametric::fill_fe_subface_values ( if (flags & update_gradients) data.shape_gradients[k][i] = fe_data.grads[k]; if (flags & update_hessians) - data.shape_hessians[k][i] = fe_data.grad_grads[k]; + data.shape_hessians[k][i] = fe_data.hessians[k]; } } } diff --git a/deal.II/source/fe/fe_poly_tensor.cc b/deal.II/source/fe/fe_poly_tensor.cc index ab42ebeefc..f19f4d788c 100644 --- a/deal.II/source/fe/fe_poly_tensor.cc +++ b/deal.II/source/fe/fe_poly_tensor.cc @@ -144,7 +144,7 @@ FE_PolyTensor::shape_value_component (const unsigned int i, { cached_point = p; cached_values.resize(poly_space.n()); - poly_space.compute(p, cached_values, cached_grads, cached_grad_grads); + poly_space.compute(p, cached_values, cached_grads, cached_hessians); } double s = 0; @@ -183,7 +183,7 @@ FE_PolyTensor::shape_grad_component (const unsigned int i, { cached_point = p; cached_grads.resize(poly_space.n()); - poly_space.compute(p, cached_values, cached_grads, cached_grad_grads); + poly_space.compute(p, cached_values, cached_grads, cached_hessians); } Tensor<1,dim> s; @@ -200,7 +200,7 @@ FE_PolyTensor::shape_grad_component (const unsigned int i, template Tensor<2,dim> -FE_PolyTensor::shape_grad_grad (const unsigned int, const Point &) const +FE_PolyTensor::shape_hessian (const unsigned int, const Point &) const { typedef FiniteElement FEE; Assert(false, typename FEE::ExcFENotPrimitive()); @@ -211,26 +211,26 @@ FE_PolyTensor::shape_grad_grad (const unsigned int, const Poi template Tensor<2,dim> -FE_PolyTensor::shape_grad_grad_component (const unsigned int i, +FE_PolyTensor::shape_hessian_component (const unsigned int i, const Point &p, const unsigned int component) const { Assert (idofs_per_cell, ExcIndexRange(i,0,this->dofs_per_cell)); Assert (component < dim, ExcIndexRange (component, 0, dim)); - if (cached_point != p || cached_grad_grads.size() == 0) + if (cached_point != p || cached_hessians.size() == 0) { cached_point = p; - cached_grad_grads.resize(poly_space.n()); - poly_space.compute(p, cached_values, cached_grads, cached_grad_grads); + cached_hessians.resize(poly_space.n()); + poly_space.compute(p, cached_values, cached_grads, cached_hessians); } Tensor<2,dim> s; if (inverse_node_matrix.n_cols() == 0) - return cached_grad_grads[i][component]; + return cached_hessians[i][component]; else for (unsigned int j=0;j::get_data ( // some scratch arrays std::vector > values(0); std::vector > grads(0); - std::vector > grad_grads(0); + std::vector > hessians(0); // initialize fields only if really // necessary. otherwise, don't @@ -293,7 +293,7 @@ FE_PolyTensor::get_data ( // that if (flags & update_hessians) { -// grad_grads.resize (this->dofs_per_cell); +// hessians.resize (this->dofs_per_cell); data->initialize_2nd (this, mapping, quadrature); } @@ -307,7 +307,7 @@ FE_PolyTensor::get_data ( for (unsigned int k=0; k::shape_grad_component (const unsigned int i, template Tensor<2,dim> -FESystem::shape_grad_grad (const unsigned int i, +FESystem::shape_hessian (const unsigned int i, const Point &p) const { Assert (idofs_per_cell, ExcIndexRange(i, 0, this->dofs_per_cell)); @@ -513,14 +513,14 @@ FESystem::shape_grad_grad (const unsigned int i, (typename FiniteElement::ExcShapeFunctionNotPrimitive(i))); return (base_element(this->system_to_base_table[i].first.first) - .shape_grad_grad(this->system_to_base_table[i].second, p)); + .shape_hessian(this->system_to_base_table[i].second, p)); } template Tensor<2,dim> -FESystem::shape_grad_grad_component (const unsigned int i, +FESystem::shape_hessian_component (const unsigned int i, const Point &p, const unsigned int component) const { @@ -548,7 +548,7 @@ FESystem::shape_grad_grad_component (const unsigned int i, // primitive; thus, there is no // need to check this here return (base_element(base). - shape_grad_grad_component(this->system_to_base_table[i].second, + shape_hessian_component(this->system_to_base_table[i].second, p, component_in_base)); }