From 029374ff1239a3372edbe53cd59a89b0e7df9080 Mon Sep 17 00:00:00 2001 From: Guido Kanschat Date: Sat, 18 Dec 2004 15:46:54 +0000 Subject: [PATCH] information on direction of normal vectors added git-svn-id: https://svn.dealii.org/trunk@9817 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/grid/geometry_info.h | 120 +++++++++++++++++++ deal.II/deal.II/source/grid/geometry_info.cc | 24 +++- 2 files changed, 143 insertions(+), 1 deletion(-) diff --git a/deal.II/deal.II/include/grid/geometry_info.h b/deal.II/deal.II/include/grid/geometry_info.h index c6140f4885..026bceb4f6 100644 --- a/deal.II/deal.II/include/grid/geometry_info.h +++ b/deal.II/deal.II/include/grid/geometry_info.h @@ -122,7 +122,37 @@ struct GeometryInfo * \end{verbatim} */ static const unsigned int dx_to_deal[vertices_per_cell]; + + /** + * For each face of the reference + * cell, this field stores the + * coordinate direction in which + * its normal vector points. + * + * Remark that this is only the + * coordinate number. The acual + * direction of the normal vector + * is obtained by multiplying the + * unit vector in this direction + * with #unit_normal_orientation. + */ + static const unsigned int unit_normal_direction[faces_per_cell]; + /** + * Orientation of the unit normal + * vector of a face of the + * reference cell. + * + * Each value is either + * 1 or -1, + * corresponding to a normal + * vector pointing in the + * positive or negative + * coordinate direction, + * respectively. + */ + static const int unit_normal_orientation[faces_per_cell]; + /** * This field store which child cells * are adjacent to a certain face of @@ -497,6 +527,36 @@ struct GeometryInfo<1> */ static const unsigned int dx_to_deal[vertices_per_cell]; + /** + * For each face of the reference + * cell, this field stores the + * coordinate direction in which + * its normal vector points. + * + * Remark that this is only the + * coordinate number. The acual + * direction of the normal vector + * is obtained by multiplying the + * unit vector in this direction + * with #unit_normal_orientation. + */ + static const unsigned int unit_normal_direction[faces_per_cell]; + + /** + * Orientation of the unit normal + * vector of a face of the + * reference cell. + * + * Each value is either + * 1 or -1, + * corresponding to a normal + * vector pointing in the + * positive or negative + * coordinate direction, + * respectively. + */ + static const int unit_normal_orientation[faces_per_cell]; + /** * This field store which child cells * are adjacent to a certain face of @@ -781,6 +841,36 @@ struct GeometryInfo<2> */ static const unsigned int dx_to_deal[vertices_per_cell]; + /** + * For each face of the reference + * cell, this field stores the + * coordinate direction in which + * its normal vector points. + * + * Remark that this is only the + * coordinate number. The acual + * direction of the normal vector + * is obtained by multiplying the + * unit vector in this direction + * with #unit_normal_orientation. + */ + static const unsigned int unit_normal_direction[faces_per_cell]; + + /** + * Orientation of the unit normal + * vector of a face of the + * reference cell. + * + * Each value is either + * 1 or -1, + * corresponding to a normal + * vector pointing in the + * positive or negative + * coordinate direction, + * respectively. + */ + static const int unit_normal_orientation[faces_per_cell]; + /** * This field store which child cells * are adjacent to a certain face of @@ -1067,6 +1157,36 @@ struct GeometryInfo<3> */ static const unsigned int dx_to_deal[vertices_per_cell]; + /** + * For each face of the reference + * cell, this field stores the + * coordinate direction in which + * its normal vector points. + * + * Remark that this is only the + * coordinate number. The acual + * direction of the normal vector + * is obtained by multiplying the + * unit vector in this direction + * with #unit_normal_orientation. + */ + static const unsigned int unit_normal_direction[faces_per_cell]; + + /** + * Orientation of the unit normal + * vector of a face of the + * reference cell. + * + * Each value is either + * 1 or -1, + * corresponding to a normal + * vector pointing in the + * positive or negative + * coordinate direction, + * respectively. + */ + static const int unit_normal_orientation[faces_per_cell]; + /** * This field store which child cells * are adjacent to a certain face of diff --git a/deal.II/deal.II/source/grid/geometry_info.cc b/deal.II/deal.II/source/grid/geometry_info.cc index 03c1728aa0..9552c67dc0 100644 --- a/deal.II/deal.II/source/grid/geometry_info.cc +++ b/deal.II/deal.II/source/grid/geometry_info.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 by the deal.II authors +// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -77,6 +77,28 @@ const unsigned int GeometryInfo<2>::dx_to_deal[GeometryInfo<2>::vertices_per_cel const unsigned int GeometryInfo<3>::dx_to_deal[GeometryInfo<3>::vertices_per_cell] = { 0, 3, 4, 7, 1, 2, 5, 6}; +//TODO: Use these values in mappings. +const unsigned int +GeometryInfo<1>::unit_normal_direction[GeometryInfo<1>::faces_per_cell] += { 0, 0 }; +const int +GeometryInfo<1>::unit_normal_orientation[GeometryInfo<1>::faces_per_cell] += { -1, 1 }; + +const unsigned int +GeometryInfo<2>::unit_normal_direction[GeometryInfo<2>::faces_per_cell] += { 1, 0, 1, 0 }; +const int +GeometryInfo<2>::unit_normal_orientation[GeometryInfo<2>::faces_per_cell] += { -1, 1, 1, -1 }; + +const unsigned int +GeometryInfo<3>::unit_normal_direction[GeometryInfo<3>::faces_per_cell] += { 1, 1, 2, 0, 2, 0 }; +const int +GeometryInfo<3>::unit_normal_orientation[GeometryInfo<3>::faces_per_cell] += { -1, 1, -1, 1, 1, -1 }; + -- 2.39.5