]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Cleanup
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 15 Jul 1999 09:00:53 +0000 (09:00 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 15 Jul 1999 09:00:53 +0000 (09:00 +0000)
git-svn-id: https://svn.dealii.org/trunk@1577 0785d39b-7218-0410-832d-ea1e28bc413d

14 files changed:
deal.II/base/include/base/data_out_base.h
deal.II/base/include/base/exceptions.h
deal.II/base/include/base/tensor_base.h
deal.II/base/include/base/tensorindex.h
deal.II/deal.II/include/dofs/dof_tools.h
deal.II/deal.II/include/multigrid/mg_smoother.h
deal.II/deal.II/include/multigrid/multigrid.h
deal.II/deal.II/include/numerics/mg_smoother.h
deal.II/deal.II/include/numerics/multigrid.h
deal.II/deal.II/source/dofs/dof_tools.cc
deal.II/deal.II/source/multigrid/multigrid.cc
deal.II/deal.II/source/numerics/multigrid.cc
deal.II/doc/parser/dealparse.l
deal.II/doc/parser/dealparse.y

index b7f87264e60a774b6836e88b942604449b55eb18..7f4e37a3dfc93183d306eea68feac74a0a554d40 100644 (file)
@@ -528,7 +528,12 @@ class DataOutBase
                                          * Structure keeping the three color
                                          * values in the RGB system.
                                          */
-       struct RgbValues { float red, green, blue; };
+       struct RgbValues
+       {
+           float red;
+           float green;
+           float blue;
+       };
 
                                         /**
                                          * Definition of a function pointer
index 487a7eb171e35fcd941fe46deda6d8864ec84d28..8f3d6b76a6a54d105ce338eb14b119a8452224a0 100644 (file)
@@ -572,7 +572,7 @@ namespace StandardExceptions
                  << "Dimension " << arg1 << " not equal to " << arg2);
   DeclException3 (ExcIndexRange, int, int, int,
                  << "Index " << arg1 << " is not in ["
-                 << arg2 << "," << arg3 << ")");
+                 << arg2 << "," << arg3 << "[");
   
 };
 
index 4280d93ed0afcac4ee4db1ac3c3f76759586d53d..be7087d42008612a20b17eb35bd6a010d68f18b1 100644 (file)
@@ -66,7 +66,7 @@ class Tensor<1,dim> {
                                      * but egcs1.1.2 chokes on that so
                                      * we need it presently.
                                      */
-    static const unsigned int array_size = (dim>0 ? dim : 1);
+    static const unsigned int array_size = ((dim!=0) ? (dim) : 1);
     
                                     /**
                                      * Declare an array type which can
@@ -195,7 +195,7 @@ class Tensor<1,dim> {
                                      * to disallow the creation of such
                                      * an object.
                                      */
-    double values[dim>0 ? dim : 1];
+    double values[(dim!=0) ? (dim) : 1];
 
                                     /**
                                      * Help function for unroll.
index beb570adaa943307cc1e0f7ce078dd967be51301..bf4e0b598a0391846a2c64c9b96424075e2eb651 100644 (file)
@@ -53,12 +53,12 @@ private:
                                   /**
                                    * Field of indices.
                                    */
-  unsigned index[4];
+  unsigned int index[4];
 public:
                                   /**
                                    * Constructor taking #rank# indices.
                                    */
-  TensorIndex(unsigned i0, unsigned i1, unsigned i2, unsigned i3)
+  TensorIndex(unsigned int i0, unsigned int i1, unsigned int i2, unsigned int i3)
       {
        index[0] = i0;
        index[1] = i1;
@@ -77,7 +77,7 @@ public:
        return index[n];
 
       }
-  DeclException1(ExcRank, unsigned,
+  DeclException1(ExcRank, unsigned int,
                 << "Index " << arg1 << " higher than maximum 3");  
 };
 
@@ -88,12 +88,12 @@ private:
                                   /**
                                    * Field of indices.
                                    */
-    unsigned index[3];
+    unsigned int index[3];
   public:
                                     /**
                                      * Constructor taking #rank# indices.
                                      */
-    TensorIndex(unsigned i0, unsigned i1, unsigned i2)
+    TensorIndex(unsigned int i0, unsigned int i1, unsigned int i2)
       {
        index[0] = i0;
        index[1] = i1;
@@ -106,14 +106,14 @@ private:
                                      * in #n#th component
                                      *
                                      */
-    unsigned operator () (unsigned n) const
+    unsigned int operator () (unsigned int n) const
       {
        Assert(n<3, ExcRank(n));
        return index[n];
 
       }
   
-    DeclException1(ExcRank, unsigned,
+    DeclException1(ExcRank, unsigned int,
                   << "Index " << arg1 << " higher than maximum 2");  
 };
 
@@ -124,12 +124,12 @@ class TensorIndex<2>
                                     /**
                                      * Field of indices.
                                      */
-    unsigned index[4];
+    unsigned int index[4];
   public:
                                     /**
                                      * Constructor taking #rank# indices.
                                      */
-    TensorIndex(unsigned i0, unsigned i1)
+    TensorIndex(unsigned int i0, unsigned int i1)
       {
        index[0] = i0;
        index[1] = i1;
@@ -140,13 +140,13 @@ class TensorIndex<2>
                                      * Access operator returning index
                                      * in #n#th component
                                      */
-    unsigned operator () (unsigned n) const
+    unsigned int operator () (unsigned int n) const
       {
        Assert(n<2, ExcRank(n));
        return index[n];
 
       }
-    DeclException1(ExcRank, unsigned,
+    DeclException1(ExcRank, unsigned int,
                   << "Index " << arg1 << " higher than maximum 1");  
 };
 
@@ -157,12 +157,12 @@ class TensorIndex<1>
                                     /**
                                      * Field of indices.
                                      */
-    unsigned index[1];
+    unsigned int index[1];
   public:
                                     /**
                                      * Constructor taking #rank# indices.
                                      */
-    TensorIndex(unsigned i0)
+    TensorIndex(unsigned int i0)
       {
        index[0] = i0;
       }
@@ -172,22 +172,22 @@ class TensorIndex<1>
                                      * Access operator returning index
                                      * in #n#th component
                                      */
-    unsigned operator () (unsigned n) const
+    unsigned int operator () (unsigned int n) const
       {
        Assert(n<1, ExcRank(n));
        return index[n];
 
       }
-    DeclException1(ExcRank, unsigned,
+    DeclException1(ExcRank, unsigned int,
                   << "Index " << arg1 << " higher than maximum 0");  
 };
 
 
 
 template<int rank>
-inline unsigned
+inline unsigned int
 TensorIndex<rank>::
-operator() (unsigned n) const
+operator() (unsigned int n) const
 {
   Assert(n<rank, ExcRank(n));
   return index[n];
index 92fea62c7d2d9578738dd03ffc75064e89a829d5..0fd8cc3d315c28da0cda4f3b7fd40f33314ec9e1 100644 (file)
@@ -36,6 +36,15 @@ class DoFTools
     static void extract_dofs(const DoFHandler<dim>& dof,
                             const bit_vector& select,
                             bit_vector& selected_dofs);
+
+                                    /**
+                                     * Same as #extract_dofs# for multi-level.
+                                     */
+    template<int dim>
+    static void extract_level_dofs(unsigned int level,
+                                  const MGDoFHandler<dim>& dof,
+                                  const bit_vector& select,
+                                  bit_vector& selected_dofs);
 };
 
 
index 110cca5eb1cdbe4b2348274abc98f3c6292b9118..6b76df8894852c4b462da50d3267eb44a6acb3bb 100644 (file)
@@ -176,7 +176,11 @@ class MGSmootherRelaxation : public MGSmoother
                                     /**
                                      * Auxiliary vector.
                                      */
-    mutable Vector<double> h1, h2;
+    mutable Vector<double> h1;
+                                    /**
+                                     * Auxiliary vector.
+                                     */
+    mutable Vector<double> h2;
 };
 
 inline
index 74a92453c0dc105bf15918c66dd6fd14fab89c7c..6086ecbdb4e407d5813af66b7096bb3613720e79 100644 (file)
@@ -101,13 +101,11 @@ class MG
  */
 class MGTransferPrebuilt : public MGTransferBase 
 {
-    const MGSmoother& smoother;
   public:
                                     /**
                                      * Preliminary constructor
                                      */
-    MGTransferPrebuilt(const MGSmoother& smoother) :
-                   smoother(smoother)
+    MGTransferPrebuilt()
       {}
     
     
index 110cca5eb1cdbe4b2348274abc98f3c6292b9118..6b76df8894852c4b462da50d3267eb44a6acb3bb 100644 (file)
@@ -176,7 +176,11 @@ class MGSmootherRelaxation : public MGSmoother
                                     /**
                                      * Auxiliary vector.
                                      */
-    mutable Vector<double> h1, h2;
+    mutable Vector<double> h1;
+                                    /**
+                                     * Auxiliary vector.
+                                     */
+    mutable Vector<double> h2;
 };
 
 inline
index 74a92453c0dc105bf15918c66dd6fd14fab89c7c..6086ecbdb4e407d5813af66b7096bb3613720e79 100644 (file)
@@ -101,13 +101,11 @@ class MG
  */
 class MGTransferPrebuilt : public MGTransferBase 
 {
-    const MGSmoother& smoother;
   public:
                                     /**
                                      * Preliminary constructor
                                      */
-    MGTransferPrebuilt(const MGSmoother& smoother) :
-                   smoother(smoother)
+    MGTransferPrebuilt()
       {}
     
     
index c8e7dc821749ef303d2f61d6b6a8216ee959a9f9..391003e19a16f6321a015f65b0ba50a13692cd17 100644 (file)
@@ -2,7 +2,9 @@
 // Copyright Guido Kanschat, 1999
 
 #include <grid/dof.h>
+#include <grid/mg_dof.h>
 #include <grid/dof_accessor.h>
+#include <grid/mg_dof_accessor.h>
 #include <grid/tria_iterator.h>
 #include <fe/fe.h>
 #include <fe/fe_system.h>
@@ -35,7 +37,39 @@ DoFTools::extract_dofs(const DoFHandler<dim>& dof,
     }
 }
 
+template<int dim>
+void
+DoFTools::extract_level_dofs(unsigned int level,
+                            const MGDoFHandler<dim>& dof,
+                            const bit_vector& local_select,
+                            bit_vector& selected_dofs)
+{
+  const FiniteElement<dim>& fe = dof.get_fe();
+  Assert(local_select.size() == fe.n_components,
+        ExcDimensionMismatch(local_select.size(), fe.n_components));
+  Assert(selected_dofs.size() == dof.n_dofs(level),
+        ExcDimensionMismatch(selected_dofs.size(), dof.n_dofs(level)));
+
+  vector<int> indices(fe.total_dofs);
+  
+  MGDoFHandler<dim>::cell_iterator c;
+  for (c = dof.begin(level) ; c != dof.end(level) ; ++ c)
+    {
+      c->get_mg_dof_indices(indices);
+      for (unsigned int i=0;i<fe.total_dofs;++i)
+       {
+         pair<unsigned int, unsigned int> comp
+           = fe.system_to_component_index(i);
+         selected_dofs[indices[i]] = local_select[comp.first];
+       }
+    }
+}
+
 template void DoFTools::extract_dofs(const DoFHandler<deal_II_dimension>& dof,
                                     const bit_vector& local_select,
                                     bit_vector& selected_dofs);
+template void DoFTools::extract_level_dofs(unsigned int level,
+                                          const MGDoFHandler<deal_II_dimension>& dof,
+                                          const bit_vector& local_select,
+                                          bit_vector& selected_dofs);
 //template DoFTools<deal_II_dimension>;
index 2785d302c6da1ed839a30550cfb2177f5ab841af..4b5c8b794670737b79fff8b85ecd22b2fdf64ad3 100644 (file)
@@ -154,7 +154,6 @@ void MGTransferPrebuilt::restrict (const unsigned int   from_level,
 {
   Assert ((from_level >= 1) && (from_level<=prolongation_matrices.size()),
          ExcIndexRange (from_level, 1, prolongation_matrices.size()+1));
-//  smoother.set_zero_interior_boundary(from_level, src);
   prolongation_matrices[from_level-1].Tvmult_add (dst, src);
 };
 
index 2785d302c6da1ed839a30550cfb2177f5ab841af..4b5c8b794670737b79fff8b85ecd22b2fdf64ad3 100644 (file)
@@ -154,7 +154,6 @@ void MGTransferPrebuilt::restrict (const unsigned int   from_level,
 {
   Assert ((from_level >= 1) && (from_level<=prolongation_matrices.size()),
          ExcIndexRange (from_level, 1, prolongation_matrices.size()+1));
-//  smoother.set_zero_interior_boundary(from_level, src);
   prolongation_matrices[from_level-1].Tvmult_add (dst, src);
 };
 
index 87e8908c7c4b901394ab77d2621c0346d8e52f9c..a3b2a7881fee90f928f001798d0dd9898aa5f2b4 100644 (file)
@@ -25,6 +25,7 @@ extern string cvs_id;
 NAME  [_a-zA-Z][_a-zA-Z0-9]*
 INT   [+-]?[0-9]+
 WHITE [ \t\n\f\v]
+ID    "$"Id[^\$]*
 CLASS (class)|(struct)|(union)
 ACCESS (public)|(protected)|(private)
 OP \+|\-|\/|\||\^|(==)|(!=)|(<<)|(>>)|(->)|(\+\+)|(\-\-)
@@ -56,9 +57,9 @@ DeclException[0-9]  { yylval = string("@") + string(yytext); return(DECLEXCEPTIO
 
  /* scan CVS id in file preamble */
 
-"$Id$]*"$" { cvs_id = string(yytext); }
-<LINECOMMENT>"$Id$]*"$" { cvs_id = string(yytext); }
-<COMMENT>"$Id$]*"$" { cvs_id = string(yytext); }
+{ID} { cvs_id = string(yytext); }
+<LINECOMMENT>{ID} { cvs_id = string(yytext); }
+<COMMENT>{ID} { cvs_id = string(yytext); }
 
 
  /* Ignore function bodies */
index 9b8a3920ee39d70ba026141e39b7fa62efa0b56a..b79a9cda2279b8336196344147e73a34e5ca7ea9 100644 (file)
@@ -38,7 +38,6 @@ void yyerror(const char* s)
 %token TYPEDEF
 %token ACCESS
 %token IDENTIFIER
-%token FARG
 %token CONST
 %token STATIC
 %token EXTERN
@@ -156,7 +155,7 @@ typedef_declaration:
 
 array_dimensions:
   '[' ']' { $$ = string("[]"); }
-  | '[' identifier ']' { $$ = string("[") + $2 + string("]"); }
+  | '[' expression ']' { $$ = string("[") + $2 + string("]"); }
   | '[' INT ']' { $$ = string("[") + $2 + string("]"); }
   | array_dimensions array_dimensions { $$ = $1 + $2; }
 ;
@@ -342,8 +341,10 @@ identifier:
 expression:
   literal
   | identifier
+  | '&' expression { $$ = string("&") + $2; }
   | OP expression { $$ = $1 + $2; }
   | expression OP expression { $$ = $1 + $2 + $3; }
+  | expression '?' expression ':' expression { $$ = string("Conditional"); }
   | expression '*' expression { $$ = $1 + $2 + $3; }
   | expression INT { $$ = $1 + $2; }
   | identifier argument_declaration { $$ = $1 + $2; }
@@ -393,22 +394,6 @@ deal_exception_declaration:
   }
 ;
 
-deal_exception_arglist: /* empty */
-  | deal_exception_arglist ',' deal_exception_arg
-;
-
-deal_exception_arg:
-  vartype
-  | deal_exception_output_declaration
-  | literal
-;
-
-deal_exception_output_declaration: OP
-  | expression
-/*  | deal_exception_output_declaration vartype
-  | deal_exception_output_declaration literal
-  | deal_exception_output_declaration OP */
-;
 
 %%
 

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.