]> https://gitweb.dealii.org/ - dealii.git/commitdiff
new function n_faces
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Tue, 18 May 2004 14:00:59 +0000 (14:00 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Tue, 18 May 2004 14:00:59 +0000 (14:00 +0000)
git-svn-id: https://svn.dealii.org/trunk@9253 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/grid/tria.h
deal.II/deal.II/source/grid/tria.all_dimensions.cc
deal.II/deal.II/source/grid/tria.cc

index 0ded2fd825142c982cfe9af834d5e1460625e7fc..1f3901019562eb68f38a83e9395c6733854ced9f 100644 (file)
@@ -3064,6 +3064,37 @@ class Triangulation : public TriaDimensionInfo<dim>,
                                      */
     unsigned int n_active_cells (const unsigned int level) const;
 
+                                    /**
+                                     *  Return total number of used faces,
+                                     *  active or not.
+                                     *  Maps to <tt>n_lines()</tt> in two space
+                                     *  dimensions and so on.
+                                     */
+    unsigned int n_faces () const;
+
+                                    /**
+                                     *  Return total number of used faces,
+                                     *  active or not, on level @p level.
+                                     *  Maps to <tt>n_lines(level)</tt> in two space
+                                     *  dimensions and so on.
+                                     */
+    unsigned int n_faces (const unsigned int level) const;
+
+                                    /**
+                                     *  Return total number of active faces.
+                                     *  Maps to <tt>n_active_lines()</tt> in two space
+                                     *  dimensions and so on.
+                                     */
+    unsigned int n_active_faces () const;
+
+                                    /**
+                                     * Return total number of active faces
+                                     * on level @p level.
+                                     * Maps to <tt>n_active_lines(level)</tt> in two
+                                     * space dimensions and so on.
+                                     */
+    unsigned int n_active_faces (const unsigned int level) const;
+
                                     /**
                                      * Return number of levels in use. This
                                      * may be less than the number of levels
index b3f53e477cad9d3ae30715ac033c34db71fd6c34..31d71d03608fc0432d7e27d2ab4de399296db41c 100644 (file)
@@ -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
@@ -114,7 +114,6 @@ CellData<3>::rotate (const unsigned int times)
 }
 
 
-
 bool
 SubCellData::check_consistency (const unsigned int dim) const
 {
index 9afb26c52e9711389ce768a193f8c3fecf047961..76d6ab59d3154cb90425c0ea94624c96bf1b953e 100644 (file)
@@ -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
@@ -4031,7 +4031,8 @@ Triangulation<dim>::end_raw_hex (const unsigned int level) const {
 
 template <int dim>
 typename TriaDimensionInfo<dim>::hex_iterator
-Triangulation<dim>::end_hex (const unsigned int level) const {
+Triangulation<dim>::end_hex (const unsigned int level) const
+{
   return (level == levels.size()-1 ?
          hex_iterator(end_hex()) :
          begin_hex (level+1));
@@ -4040,7 +4041,8 @@ Triangulation<dim>::end_hex (const unsigned int level) const {
 
 template <int dim>
 typename TriaDimensionInfo<dim>::active_hex_iterator
-Triangulation<dim>::end_active_hex (const unsigned int level) const {
+Triangulation<dim>::end_active_hex (const unsigned int level) const
+{
   return (level == levels.size()-1 ?
          active_hex_iterator(end_hex()) :
          begin_active_hex (level+1));
@@ -4048,7 +4050,8 @@ Triangulation<dim>::end_active_hex (const unsigned int level) const {
 
 
 template <int dim>
-unsigned int Triangulation<dim>::n_cells () const {
+unsigned int Triangulation<dim>::n_cells () const
+{
   unsigned int n=0;
   for (unsigned int l=0; l<levels.size(); ++l)
     n += n_cells (l);
@@ -4057,7 +4060,8 @@ unsigned int Triangulation<dim>::n_cells () const {
 
 
 template <int dim>
-unsigned int Triangulation<dim>::n_active_cells () const {
+unsigned int Triangulation<dim>::n_active_cells () const
+{
   unsigned int n=0;
   for (unsigned int l=0; l<levels.size(); ++l)
     n += n_active_cells (l);
@@ -4065,6 +4069,48 @@ unsigned int Triangulation<dim>::n_active_cells () const {
 }
 
 
+template <int dim>
+unsigned int Triangulation<dim>::n_faces () const
+{
+  unsigned int n=0;
+  for (unsigned int l=0; l<levels.size(); ++l)
+    n += n_faces (l);
+  return n;
+}
+
+
+template <int dim>
+unsigned int Triangulation<dim>::n_active_faces () const
+{
+  unsigned int n=0;
+  for (unsigned int l=0; l<levels.size(); ++l)
+    n += n_active_faces (l);
+  return n;
+}
+
+
+template <int dim>
+unsigned int
+Triangulation<dim>::n_faces(unsigned int l) const
+{
+  if (dim==2) return n_lines(l);
+  if (dim==3) return n_quads(l);
+  return 0;
+}
+
+
+
+template <int dim>
+unsigned int
+Triangulation<dim>::n_active_faces(unsigned int l) const
+{
+  if (dim==2) return n_active_lines(l);
+  if (dim==3) return n_active_quads(l);
+  return 0;
+}
+
+
+
 #if deal_II_dimension == 1
 
 template <>

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.