From c72310f87d839f053445972ee98dd62a07c6072e Mon Sep 17 00:00:00 2001 From: hartmann Date: Thu, 30 Jun 2005 15:10:30 +0000 Subject: [PATCH] Check StraightBoundary<3>::get_normals_at_vertices. git-svn-id: https://svn.dealii.org/trunk@10986 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/deal.II/normals_at_vertices.cc | 84 ++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 tests/deal.II/normals_at_vertices.cc diff --git a/tests/deal.II/normals_at_vertices.cc b/tests/deal.II/normals_at_vertices.cc new file mode 100644 index 0000000000..3187f50513 --- /dev/null +++ b/tests/deal.II/normals_at_vertices.cc @@ -0,0 +1,84 @@ +//---------------------------- normals_at_vertices.cc --------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2005 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. +// +//---------------------------- normals_at_vertices.cc --------------------------- + + +/* Author: Ralf Hartmann, 2005 */ + + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include + +#include + + + +void create_triangulation(const unsigned int case_no, + Triangulation<3> &tria) +{ + switch (case_no) + { + case 0: + GridGenerator::hyper_cube(tria, 1., 3.); + break; + case 1: + { + GridGenerator::hyper_cube(tria, 1., 3.); + Point<3> &v0=tria.begin_active()->vertex(0); + v0 = Point<3> (0,-0.5,-1); + Point<3> &v1=tria.begin_active()->vertex(1); + v1 = Point<3> (1.25, 0.25, 0.25); + break; + } + default: + Assert(false, ExcNotImplemented()); + }; +} + + + +int main () +{ + std::ofstream logfile ("normals_at_vertices.output"); + logfile.precision (3); + logfile.setf(std::ios::fixed); + deallog.attach(logfile); + deallog.depth_console (0); + + Triangulation<3> tria; + StraightBoundary<3> boundary; + Boundary<3>::FaceVertexNormals normals; + for (unsigned int case_no=0; case_no<1; ++case_no) + { + deallog << "Case" << case_no << endl; + create_triangulation(case_no, tria); + const Triangulation<3>::active_cell_iterator cell=tria.begin_active(); + Triangulation<3>::face_iterator face; + for (unsigned int face_no=0; face_no<1/*GeometryInfo<3>::faces_per_cell*/; ++face_no) + { + deallog << " Face" << face_no << std::endl; + face=cell->face(face_no); + boundary.get_normals_at_vertices(face, normals); + for (unsigned int v=0; v::vertices_per_face; ++v) + deallog << " vertex=" << face->vertex(v) + << ", normal=" << normals[v] << std::endl; + } + tria.clear(); + } +} -- 2.39.5