From 9d62f2b84cbfdfc62ad1471e420608e200999e0a Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Fri, 28 Feb 2020 19:27:24 +0100 Subject: [PATCH] Add test case --- tests/base/geometry_info_10.cc | 60 ++++++++++++++++++++++++++++++ tests/base/geometry_info_10.output | 45 ++++++++++++++++++++++ 2 files changed, 105 insertions(+) create mode 100644 tests/base/geometry_info_10.cc create mode 100644 tests/base/geometry_info_10.output diff --git a/tests/base/geometry_info_10.cc b/tests/base/geometry_info_10.cc new file mode 100644 index 0000000000..01e586cc36 --- /dev/null +++ b/tests/base/geometry_info_10.cc @@ -0,0 +1,60 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2020 by the deal.II authors +// +// This file is part of the deal.II library. +// +// The deal.II library is free software; you can use it, redistribute +// it, and/or modify it under the terms of the GNU Lesser General +// Public License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// The full text of the license can be found in the file LICENSE.md at +// the top level directory of deal.II. +// +// --------------------------------------------------------------------- + +// Test GeometryInfo::unit_tangential_vectors + +#include + +#include "../tests.h" + + +template +void +test() +{ + for (unsigned int i = 0; i < GeometryInfo::faces_per_cell; ++i) + { + const Tensor<1, dim> unit_normal_vector = + GeometryInfo::unit_normal_vector[i]; + deallog << "Direction " << i << " = " << unit_normal_vector << std::endl; + + deallog << "Tangential vectors: "; + for (const auto t : GeometryInfo::unit_tangential_vectors[i]) + deallog << t << " ; "; + deallog << std::endl; + } + deallog << "OK" << std::endl; +} + + +int +main() +{ + initlog(); + + deallog.push("1d"); + test<1>(); + deallog.pop(); + deallog.push("2d"); + test<2>(); + deallog.pop(); + deallog.push("3d"); + test<3>(); + deallog.pop(); + deallog.push("4d"); + test<4>(); + deallog.pop(); + return 0; +} diff --git a/tests/base/geometry_info_10.output b/tests/base/geometry_info_10.output new file mode 100644 index 0000000000..e404d0a072 --- /dev/null +++ b/tests/base/geometry_info_10.output @@ -0,0 +1,45 @@ + +DEAL:1d::Direction 0 = -1.00000 +DEAL:1d::Tangential vectors: +DEAL:1d::Direction 1 = 1.00000 +DEAL:1d::Tangential vectors: +DEAL:1d::OK +DEAL:2d::Direction 0 = -1.00000 0.00000 +DEAL:2d::Tangential vectors: 0.00000 -1.00000 ; +DEAL:2d::Direction 1 = 1.00000 0.00000 +DEAL:2d::Tangential vectors: 0.00000 1.00000 ; +DEAL:2d::Direction 2 = 0.00000 -1.00000 +DEAL:2d::Tangential vectors: 1.00000 0.00000 ; +DEAL:2d::Direction 3 = 0.00000 1.00000 +DEAL:2d::Tangential vectors: -1.00000 0.00000 ; +DEAL:2d::OK +DEAL:3d::Direction 0 = -1.00000 0.00000 0.00000 +DEAL:3d::Tangential vectors: 0.00000 -1.00000 0.00000 ; 0.00000 0.00000 1.00000 ; +DEAL:3d::Direction 1 = 1.00000 0.00000 0.00000 +DEAL:3d::Tangential vectors: 0.00000 1.00000 0.00000 ; 0.00000 0.00000 1.00000 ; +DEAL:3d::Direction 2 = 0.00000 -1.00000 0.00000 +DEAL:3d::Tangential vectors: 0.00000 0.00000 -1.00000 ; 1.00000 0.00000 0.00000 ; +DEAL:3d::Direction 3 = 0.00000 1.00000 0.00000 +DEAL:3d::Tangential vectors: 0.00000 0.00000 1.00000 ; 1.00000 0.00000 0.00000 ; +DEAL:3d::Direction 4 = 0.00000 0.00000 -1.00000 +DEAL:3d::Tangential vectors: -1.00000 0.00000 0.00000 ; 0.00000 1.00000 0.00000 ; +DEAL:3d::Direction 5 = 0.00000 0.00000 1.00000 +DEAL:3d::Tangential vectors: 1.00000 0.00000 0.00000 ; 0.00000 1.00000 0.00000 ; +DEAL:3d::OK +DEAL:4d::Direction 0 = -1.00000 0.00000 0.00000 0.00000 +DEAL:4d::Tangential vectors: 0.00000 -1.00000 0.00000 0.00000 ; 0.00000 0.00000 1.00000 0.00000 ; 0.00000 0.00000 0.00000 1.00000 ; +DEAL:4d::Direction 1 = 1.00000 0.00000 0.00000 0.00000 +DEAL:4d::Tangential vectors: 0.00000 1.00000 0.00000 0.00000 ; 0.00000 0.00000 1.00000 0.00000 ; 0.00000 0.00000 0.00000 1.00000 ; +DEAL:4d::Direction 2 = 0.00000 -1.00000 0.00000 0.00000 +DEAL:4d::Tangential vectors: 0.00000 0.00000 -1.00000 0.00000 ; 0.00000 0.00000 0.00000 1.00000 ; 1.00000 0.00000 0.00000 0.00000 ; +DEAL:4d::Direction 3 = 0.00000 1.00000 0.00000 0.00000 +DEAL:4d::Tangential vectors: 0.00000 0.00000 1.00000 0.00000 ; 0.00000 0.00000 0.00000 1.00000 ; 1.00000 0.00000 0.00000 0.00000 ; +DEAL:4d::Direction 4 = 0.00000 0.00000 -1.00000 0.00000 +DEAL:4d::Tangential vectors: 0.00000 0.00000 0.00000 -1.00000 ; 1.00000 0.00000 0.00000 0.00000 ; 0.00000 1.00000 0.00000 0.00000 ; +DEAL:4d::Direction 5 = 0.00000 0.00000 1.00000 0.00000 +DEAL:4d::Tangential vectors: 0.00000 0.00000 0.00000 1.00000 ; 1.00000 0.00000 0.00000 0.00000 ; 0.00000 1.00000 0.00000 0.00000 ; +DEAL:4d::Direction 6 = 0.00000 0.00000 0.00000 -1.00000 +DEAL:4d::Tangential vectors: -1.00000 0.00000 0.00000 0.00000 ; 0.00000 1.00000 0.00000 0.00000 ; 0.00000 0.00000 1.00000 0.00000 ; +DEAL:4d::Direction 7 = 0.00000 0.00000 0.00000 1.00000 +DEAL:4d::Tangential vectors: 1.00000 0.00000 0.00000 0.00000 ; 0.00000 1.00000 0.00000 0.00000 ; 0.00000 0.00000 1.00000 0.00000 ; +DEAL:4d::OK -- 2.39.5