From: kronbichler Date: Sun, 11 Mar 2012 13:11:13 +0000 (+0000) Subject: Test inverse Jacobians. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7d94ee26ba1d6d0b663d291352a65ecef882c365;p=dealii-svn.git Test inverse Jacobians. git-svn-id: https://svn.dealii.org/trunk@25249 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h index c16b1b6e5f..090b99eea9 100644 --- a/deal.II/doc/news/changes.h +++ b/deal.II/doc/news/changes.h @@ -152,6 +152,12 @@ enabled due to a missing include file in file

Specific improvements

    +
  1. Fixed: +The method FEValues::inverse_jacobian() previously returned the transpose of the +inverse Jacobians instead of just the inverse Jacobian as documented. This is now fixed. +
    +(Sebastian Pauletti, Katharina Kormann, Martin Kronbichler, 2012/03/11) +
  2. Extended: SolutionTransfer is now also able to transfer solutions between hp::DoFHandler where the finite element index changes during refinement. diff --git a/tests/fe/jacobians.cc b/tests/fe/jacobians.cc new file mode 100644 index 0000000000..83eb4799fa --- /dev/null +++ b/tests/fe/jacobians.cc @@ -0,0 +1,91 @@ +//---------------------------- jacobians.cc --------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2012 by the deal.II authors +// +// This file is subject to QPL and may not be distributed +// without copyright and license information. Please refer +// to the file deal.II/doc/license.html for the text and +// further information on this license. +// +//---------------------------- jacobians.cc --------------------------- + +// Show the Jacobians and inverse Jacobians on hyperball with one quadrature +// point + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include + +template +void test() +{ + Triangulation tria; + GridGenerator::hyper_ball (tria); + static const HyperBallBoundary boundary; + tria.set_boundary (0, boundary); + + MappingQ mapping(3); + FE_Nothing dummy; + // choose a point that is not right in the + // middle of the cell so that the Jacobian + // contains many nonzero entries + Point quad_p; + for (int d=0; d quad(quad_p); + FEValues fe_val (mapping, dummy, quad, + update_jacobians | update_inverse_jacobians); + deallog << dim << "d Jacobians:" << std::endl; + typename Triangulation::active_cell_iterator + cell = tria.begin_active(), endc = tria.end(); + for ( ; cell != endc; ++cell) + { + fe_val.reinit (cell); + + for (unsigned int d=0; d(); + test<3>(); + + return 0; +} + + + diff --git a/tests/fe/jacobians/cmp/generic b/tests/fe/jacobians/cmp/generic new file mode 100644 index 0000000000..56cc9df7ca --- /dev/null +++ b/tests/fe/jacobians/cmp/generic @@ -0,0 +1,33 @@ + +DEAL::2d Jacobians: +DEAL::1.0000 0 0 0.4142 +DEAL::0.4142 0 0 1.0000 +DEAL::0.5858 0 0 0.5858 +DEAL::0 -0.4142 1.0000 0 +DEAL::0 1.0000 -0.4142 0 +DEAL:: +DEAL::2d inverse Jacobians: +DEAL::1.0000 0 0 2.4142 +DEAL::2.4142 0 0 1.0000 +DEAL::1.7071 0 0 1.7071 +DEAL::0 1.0000 -2.4142 0 +DEAL::0 -2.4142 1.0000 0 +DEAL:: +DEAL::3d Jacobians: +DEAL::0.4226 0 0 0 0.4226 0 0 0 0.4226 +DEAL::0.7887 0 0 0 0.7887 0 0 0 0.3660 +DEAL::0 -0.3660 0 0.7887 0 0 0 0 0.7887 +DEAL::0.7887 0 0 0 0 0.7887 0 -0.3660 0 +DEAL::0.3660 0 0 0 0.7887 0 0 0 0.7887 +DEAL::0.7887 0 0 0 0.3660 0 0 0 0.7887 +DEAL::0 0.7887 0 -0.3660 0 0 0 0 0.7887 +DEAL:: +DEAL::3d inverse Jacobians: +DEAL::2.3660 0 0 0 2.3660 0 0 0 2.3660 +DEAL::1.2679 0 0 0 1.2679 0 0 0 2.7321 +DEAL::0 1.2679 0 -2.7321 0 0 0 0 1.2679 +DEAL::1.2679 0 0 0 0 -2.7321 0 1.2679 0 +DEAL::2.7321 0 0 0 1.2679 0 0 0 1.2679 +DEAL::1.2679 0 0 0 2.7321 0 0 0 1.2679 +DEAL::0 -2.7321 0 1.2679 0 0 0 0 1.2679 +DEAL::