]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add the two missing functions and fix trivial bug.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 29 Jun 1998 11:12:36 +0000 (11:12 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 29 Jun 1998 11:12:36 +0000 (11:12 +0000)
git-svn-id: https://svn.dealii.org/trunk@415 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/fe/fe_lib.quadratic.cc

index 3fb43efa0c2e0f7c7d80a9d31903df1ddbbe1b2b..d80f08fe6b530745348bf23d1d4ab8e8ede109a2 100644 (file)
@@ -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;
 };
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.