From: Wolfgang Bangerth Date: Mon, 29 Jun 1998 11:12:36 +0000 (+0000) Subject: Add the two missing functions and fix trivial bug. X-Git-Tag: v8.0.0~22839 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8c58e231c0fe8dfa989ca07fb580cf974ff378cb;p=dealii.git Add the two missing functions and fix trivial bug. git-svn-id: https://svn.dealii.org/trunk@415 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/source/fe/fe_lib.quadratic.cc b/deal.II/deal.II/source/fe/fe_lib.quadratic.cc index 3fb43efa0c..d80f08fe6b 100644 --- a/deal.II/deal.II/source/fe/fe_lib.quadratic.cc +++ b/deal.II/deal.II/source/fe/fe_lib.quadratic.cc @@ -138,8 +138,8 @@ FEQuadraticSub<1>::shape_grad(const unsigned int i, template <> inline Point<1> -FELinear<1>::linear_shape_grad(const unsigned int i, - const Point<1>&) const +FEQuadraticSub<1>::linear_shape_grad(const unsigned int i, + const Point<1>&) const { Assert((i<2), ExcInvalidIndex(i)); switch (i) @@ -641,6 +641,25 @@ FEQuadraticSub<2>::shape_value (const unsigned int i, +template <> +inline +double +FEQuadraticSub<2>::linear_shape_value (const unsigned int i, + const Point<2>& p) const +{ + Assert((i<4), ExcInvalidIndex(i)); + switch (i) + { + case 0: return (1.-p(0)) * (1.-p(1)); + case 1: return p(0) * (1.-p(1)); + case 2: return p(0) * p(1); + case 3: return (1.-p(0)) * p(1); + } + return 0.; +}; + + + template <> Point<2> FEQuadraticSub<2>::shape_grad (const unsigned int i, @@ -676,6 +695,25 @@ FEQuadraticSub<2>::shape_grad (const unsigned int i, +template <> +inline +Point<2> +FEQuadraticSub<2>::linear_shape_grad (const unsigned int i, + const Point<2>& p) const +{ + Assert((i<4), ExcInvalidIndex(i)); + switch (i) + { + case 0: return Point<2> (p(1)-1., p(0)-1.); + case 1: return Point<2> (1.-p(1), -p(0)); + case 2: return Point<2> (p(1), p(0)); + case 3: return Point<2> (-p(1), 1.-p(0)); + } + return Point<2> (); +}; + + + template <> void FEQuadraticSub<2>::get_local_mass_matrix (const DoFHandler<2>::cell_iterator &cell, const Boundary<2> &, @@ -990,7 +1028,7 @@ void FEQuadraticSub<2>::get_face_ansatz_points (const typename DoFHandler<2>::fa for (unsigned int vertex=0; vertex<2; ++vertex) ansatz_points[vertex] = face->vertex(vertex); - ansatz_points[2] = (ansatz_points[0] + ansatz_points[1]) / 1; + ansatz_points[2] = (ansatz_points[0] + ansatz_points[1]) / 2; };