From af82a5f9fe7eca31186e0f2793d810c54b254d06 Mon Sep 17 00:00:00 2001 From: kronbichler Date: Thu, 17 Jan 2013 10:12:25 +0000 Subject: [PATCH] Test with negative Jacobian determinant. git-svn-id: https://svn.dealii.org/trunk@28098 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/fe/negative_jac_det.cc | 75 +++++++++++++++++++++++++++ tests/fe/negative_jac_det/cmp/generic | 2 + 2 files changed, 77 insertions(+) create mode 100644 tests/fe/negative_jac_det.cc create mode 100644 tests/fe/negative_jac_det/cmp/generic diff --git a/tests/fe/negative_jac_det.cc b/tests/fe/negative_jac_det.cc new file mode 100644 index 0000000000..766bf79c84 --- /dev/null +++ b/tests/fe/negative_jac_det.cc @@ -0,0 +1,75 @@ +//---------------------------- negative_jac_det.cc ------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2013 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. +// +//---------------------------- negative_jac_det.cc ------------------------- + +// Test that the computation of the Jacobian determinant is correct also when +// the mesh is in a non-standard orientation + +#include "../tests.h" +#include +#include +#include +#include +#include + + +void test() +{ + const int dim = 2; + Triangulation tria; + std::vector > points (4); + points[0] = (Point (0, 0)); + points[1] = (Point (0, 1)); + points[2] = (Point (1, 0)); + points[3] = (Point (1, 1)); + + std::vector > cells (1); + cells[0].vertices[0] = 0; + cells[0].vertices[1] = 1; + cells[0].vertices[2] = 2; + cells[0].vertices[3] = 3; + cells[0].material_id = 0; + + tria.create_triangulation(points, cells, SubCellData()); + + FE_Nothing dummy; + QGauss quad(2); + FEValues fe_val (dummy, quad, update_JxW_values); + double integral = 0.; + /*typename*/ Triangulation::active_cell_iterator + cell = tria.begin_active(), endc = tria.end(); + for ( ; cell != endc; ++cell) + { + fe_val.reinit (cell); + for (unsigned int q=0; q