]> https://gitweb.dealii.org/ - dealii.git/commitdiff
added description of integration of distorted cell and modified test
authorNicola Giuliani <ngiuliani@sissa.it>
Thu, 23 Jan 2020 07:57:12 +0000 (08:57 +0100)
committerNicola Giuliani <ngiuliani@sissa.it>
Thu, 23 Jan 2020 07:57:12 +0000 (08:57 +0100)
source/grid/tria_accessor.cc
tests/codim_one/measure_of_distorted_codim_one_face.cc

index 09015c006a71ab184a89a279f278f8623f8d73a8..a26edc3eea6e8bc7123f84b3a99715387740c7d7 100644 (file)
@@ -1312,7 +1312,12 @@ namespace
                  ((v03 * v03) * (v01 * v01) * (v02 * v02))) >= 1e-24)
       {
         // If the vectors are non planar we integrate the norm of the normal
-        // vector using a numerical Gauss scheme of order 4.
+        // vector using a numerical Gauss scheme of order 4. In particular we
+        // consider a bilinear quad x(u,v) = (1-v)((1-u)v_0 + u v_1) +
+        // v((1-u)v_2 + u v_3), consequently we compute the normal vector as
+        // n(u,v) = t_u x t_v = w_1 + u w_2 + v w_3. The integrand function is
+        // || n(u,v) || = sqrt(a + b u^2 + c v^2 + d u + e v + f uv).
+        // We integrate it using a QGauss<2> (4) computed explicitly.
         const Tensor<1, 3> w_1 =
           cross_product_3d(accessor.vertex(1) - accessor.vertex(0),
                            accessor.vertex(2) - accessor.vertex(0));
index 342a64f10026cd710a4b1f2d587d37112bafb96d..9ae5eedc3a3b3b5b4577634c389a93dd5db5860b 100644 (file)
@@ -43,11 +43,7 @@ test()
   std::vector<CellData<2>> cells;
   SubCellData              subcelldata;
 
-  double tol = 1e-12;
-  // vertices.push_back(Point<3>{10, 56, 0});
-  // vertices.push_back(Point<3>{22, 1, 0});
-  // vertices.push_back(Point<3>{15, 44, 0});
-  // vertices.push_back(Point<3>{1, 1, 1});
+  const double tol = 1e-12;
   vertices.push_back(Point<3>{0, 0, 1});
   vertices.push_back(Point<3>{1, 0, -10});
   vertices.push_back(Point<3>{0, 1, -1});
@@ -70,12 +66,10 @@ test()
   MappingQ1<2, 3> mapping;
   FEValues<2, 3>  fe_values(mapping, fe, quadrature_formula, update_JxW_values);
 
-  double sum_1    = 0;
-  double sum_2    = 0;
-  auto   cell     = dof_handler.begin_active();
-  auto   accessor = tria.begin_active();
+  double sum_2 = 0;
+  auto   cell  = dof_handler.begin_active();
 
-  sum_1 = cell->measure();
+  const double sum_1 = cell->measure();
   fe_values.reinit(cell);
   for (unsigned int q = 0; q < quadrature_formula.size(); ++q)
     {

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.