]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Get rid of the old idiom where we had to cast the result of update flag concatenation...
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 7 Feb 2006 05:17:40 +0000 (05:17 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 7 Feb 2006 05:17:40 +0000 (05:17 +0000)
git-svn-id: https://svn.dealii.org/trunk@12247 0785d39b-7218-0410-832d-ea1e28bc413d

13 files changed:
deal.II/examples/step-10/step-10.cc
deal.II/examples/step-12/step-12.cc
deal.II/examples/step-13/step-13.cc
deal.II/examples/step-14/step-14.cc
deal.II/examples/step-15/step-15.cc
deal.II/examples/step-16/step-16.cc
deal.II/examples/step-17/step-17.cc
deal.II/examples/step-18/step-18.cc
deal.II/examples/step-20/step-20.cc
deal.II/examples/step-21/step-21.cc
deal.II/examples/step-7/step-7.cc
deal.II/examples/step-8/step-8.cc
deal.II/examples/step-9/step-9.cc

index 0b02fc6c84b07efc04fc9b785268b92cea4932ab..64ecff8720c766f06680f9027724458f4a7ff2e6 100644 (file)
@@ -4,7 +4,7 @@
 /*    $Id$       */
 /*    Version: $Name$                                          */
 /*                                                                */
-/*    Copyright (C) 2001, 2002, 2003, 2004 by the deal.II authors */
+/*    Copyright (C) 2001, 2002, 2003, 2004, 2006 by the deal.II authors */
 /*                                                                */
 /*    This file is subject to QPL and may not be  distributed     */
 /*    without copyright and license information. Please refer     */
@@ -385,7 +385,7 @@ void compute_pi_by_area ()
                                       // the dummy finite element and
                                       // the quadrature object to the
                                       // constructor, together with
-                                      // the UpdateFlags asking for
+                                      // the update flags asking for
                                       // the `JxW' values at the
                                       // quadrature points only. This
                                       // tells the FEValues object
@@ -409,7 +409,8 @@ void compute_pi_by_area ()
                                       // omitted, resulting in the
                                       // implicit use of an object of
                                       // type MappingQ1.
-      FEValues<dim> fe_values (mapping, dummy_fe, quadrature, update_JxW_values);
+      FEValues<dim> fe_values (mapping, dummy_fe, quadrature,
+                               update_JxW_values);
 
                                       // We employ an object of the
                                       // ConvergenceTable class to
@@ -577,7 +578,8 @@ void compute_pi_by_perimeter ()
                                       // the previous
                                       // function. Again, we pass a
                                       // mapping as first argument.
-      FEFaceValues<dim> fe_face_values (mapping, fe, quadrature, update_JxW_values);
+      FEFaceValues<dim> fe_face_values (mapping, fe, quadrature,
+                                        update_JxW_values);
       ConvergenceTable table;
 
       for (unsigned int refinement=0; refinement<6;
index 14657c8fa465a374764d0a7476b9af85d9b856db..8ba4184f188be1363eacbd0a0e89480620c840d3 100644 (file)
@@ -4,7 +4,7 @@
 /*    $Id$       */
 /*    Version: $Name$                                          */
 /*                                                                */
-/*    Copyright (C) 2001, 2002, 2003, 2004, 2005 by the deal.II authors */
+/*    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors */
 /*                                                                */
 /*    This file is subject to QPL and may not be  distributed     */
 /*    without copyright and license information. Please refer     */
@@ -736,21 +736,21 @@ void DGMethod<dim>::assemble_system1 ()
   std::vector<unsigned int> dofs_neighbor (dofs_per_cell);
 
                                   // First we create the
-                                  // ``UpdateFlags'' for the
+                                  // ``update_flags'' for the
                                   // ``FEValues'' and the
                                   // ``FEFaceValues'' objects.
-  UpdateFlags update_flags = update_values
-                            | update_gradients
-                            | update_q_points
-                            | update_JxW_values;
+  const UpdateFlags update_flags = update_values
+                                   | update_gradients
+                                   | update_q_points
+                                   | update_JxW_values;
 
                                   // Note, that on faces we do not
                                   // need gradients but we need
                                   // normal vectors.
-  UpdateFlags face_update_flags = update_values
-                                 | update_q_points
-                                 | update_JxW_values
-                                 | update_normal_vectors;
+  const UpdateFlags face_update_flags = update_values
+                                        | update_q_points
+                                        | update_JxW_values
+                                        | update_normal_vectors;
   
                                   // On the neighboring cell we only
                                   // need the shape values. Given a
@@ -760,7 +760,7 @@ void DGMethod<dim>::assemble_system1 ()
                                   // the normal vectors are known to
                                   // be the negative of the normal
                                   // vectors of the current cell.
-  UpdateFlags neighbor_face_update_flags = update_values;
+  const UpdateFlags neighbor_face_update_flags = update_values;
    
                                   // Then we create the ``FEValues''
                                   // object. Note, that since version
@@ -1221,17 +1221,17 @@ void DGMethod<dim>::assemble_system2 ()
   std::vector<unsigned int> dofs (dofs_per_cell);
   std::vector<unsigned int> dofs_neighbor (dofs_per_cell);
 
-  UpdateFlags update_flags = update_values
-                            | update_gradients
-                            | update_q_points
-                            | update_JxW_values;
+  const UpdateFlags update_flags = update_values
+                                   | update_gradients
+                                   | update_q_points
+                                   | update_JxW_values;
   
-  UpdateFlags face_update_flags = update_values
-                                 | update_q_points
-                                 | update_JxW_values
-                                 | update_normal_vectors;
+  const UpdateFlags face_update_flags = update_values
+                                        | update_q_points
+                                        | update_JxW_values
+                                        | update_normal_vectors;
   
-  UpdateFlags neighbor_face_update_flags = update_values;
+  const UpdateFlags neighbor_face_update_flags = update_values;
 
                                   // Here we do not need
                                   // ``fe_v_face_neighbor'' as case 4
index dbcc787db6287ba6ec811256506ab0b10385ed2c..78b5705a0680deefa2924c566bbcc053802fdb41 100644 (file)
@@ -1248,8 +1248,7 @@ namespace LaplaceSolver
                                Threads::ThreadMutex                                 &mutex) const
   {
     FEValues<dim> fe_values (*fe, *quadrature, 
-                            UpdateFlags(update_gradients |
-                                        update_JxW_values));
+                            update_gradients | update_JxW_values);
 
     const unsigned int   dofs_per_cell = fe->dofs_per_cell;
     const unsigned int   n_q_points    = quadrature->n_quadrature_points;
@@ -1578,9 +1577,8 @@ namespace LaplaceSolver
   assemble_rhs (Vector<double> &rhs) const 
   {
     FEValues<dim> fe_values (*this->fe, *this->quadrature, 
-                            UpdateFlags(update_values    |
-                                        update_q_points  |
-                                        update_JxW_values));
+                            update_values | update_q_points  |
+                             update_JxW_values);
 
     const unsigned int   dofs_per_cell = this->fe->dofs_per_cell;
     const unsigned int   n_q_points    = this->quadrature->n_quadrature_points;
index fd6f0ef6f0f4c3f06762fb37f3500f5645b9e9fa..ca5e7877d0a80bf96e1fd26a83ede52f64857813 100644 (file)
@@ -677,8 +677,7 @@ namespace LaplaceSolver
                                Threads::ThreadMutex                                 &mutex) const
   {
     FEValues<dim> fe_values (*fe, *quadrature, 
-                            UpdateFlags(update_gradients |
-                                        update_JxW_values));
+                            update_gradients | update_JxW_values);
 
     const unsigned int   dofs_per_cell = fe->dofs_per_cell;
     const unsigned int   n_q_points    = quadrature->n_quadrature_points;
@@ -932,9 +931,8 @@ namespace LaplaceSolver
   assemble_rhs (Vector<double> &rhs) const 
   {
     FEValues<dim> fe_values (*this->fe, *this->quadrature, 
-                            UpdateFlags(update_values    |
-                                        update_q_points  |
-                                        update_JxW_values));
+                            update_values  | update_q_points  |
+                             update_JxW_values);
 
     const unsigned int   dofs_per_cell = this->fe->dofs_per_cell;
     const unsigned int   n_q_points    = this->quadrature->n_quadrature_points;
index 0b76b8f7451a04f0b54fd4559e64c21951082b22..ed34c4505689040365994fc1b7b0be233afb8e25 100644 (file)
@@ -407,10 +407,8 @@ void MinimizationProblem<dim>::assemble_step ()
                                    // the one we have chosen here.
   QGauss<dim>  quadrature_formula(4);
   FEValues<dim> fe_values (fe, quadrature_formula, 
-                          UpdateFlags(update_values    |
-                                      update_gradients |
-                                      update_q_points  |
-                                      update_JxW_values));
+                          update_values   | update_gradients |
+                           update_q_points | update_JxW_values);
 
                                    // Next, here are the usual two convenience
                                    // variables, followed by declarations for
@@ -1252,10 +1250,8 @@ MinimizationProblem<dim>::energy (const DoFHandler<dim> &dof_handler,
                                    // is appropriate:
   QGauss<dim>  quadrature_formula(4);
   FEValues<dim> fe_values (dof_handler.get_fe(), quadrature_formula, 
-                          UpdateFlags(update_values    |
-                                      update_gradients |
-                                      update_q_points  |
-                                      update_JxW_values));
+                          update_values   | update_gradients |
+                           update_q_points | update_JxW_values);
 
   const unsigned int   n_q_points    = quadrature_formula.n_quadrature_points;
 
index 3c8cf5cedc1d7e39582662f2a4b32b68ed4dbb1f..14bf6f0872f406ef605e5e2d8967bc35bc69d864 100644 (file)
@@ -191,10 +191,8 @@ void LaplaceProblem<dim>::assemble_system ()
   QGauss<dim>  quadrature_formula(2);
 
   FEValues<dim> fe_values (fe, quadrature_formula, 
-                          UpdateFlags(update_values    |
-                                      update_gradients |
-                                      update_q_points  |
-                                      update_JxW_values));
+                          update_values   | update_gradients |
+                           update_q_points | update_JxW_values);
 
   const unsigned int   dofs_per_cell = fe.dofs_per_cell;
   const unsigned int   n_q_points    = quadrature_formula.n_quadrature_points;
@@ -298,10 +296,8 @@ void LaplaceProblem<dim>::assemble_multigrid ()
   QGauss<dim>  quadrature_formula(2);
 
   FEValues<dim> fe_values (fe, quadrature_formula, 
-                          UpdateFlags(update_values |
-                                      update_gradients |
-                                      update_q_points  |
-                                      update_JxW_values));
+                          update_values   | update_gradients |
+                           update_q_points | update_JxW_values);
 
   const unsigned int   dofs_per_cell = fe.dofs_per_cell;
   const unsigned int   n_q_points    = quadrature_formula.n_quadrature_points;
index aa78eb78fdec6fc78a7398e559a8f65c8c67cded..09d003db4a2a6e55829f8f1b00492655f3f0c2c4 100644 (file)
@@ -511,10 +511,8 @@ void ElasticProblem<dim>::assemble_system ()
                                    // the local systems.
   QGauss<dim>  quadrature_formula(2);
   FEValues<dim> fe_values (fe, quadrature_formula, 
-                          UpdateFlags(update_values    |
-                                      update_gradients |
-                                      update_q_points  |
-                                      update_JxW_values));
+                          update_values   | update_gradients |
+                           update_q_points | update_JxW_values);
 
   const unsigned int   dofs_per_cell = fe.dofs_per_cell;
   const unsigned int   n_q_points    = quadrature_formula.n_quadrature_points;
index b4e6d87f60490a5f93936ae2db1bc40d4f9e5c0b..7067de6d958a5a3daff7aec58aef6ea4820dbbfd 100644 (file)
@@ -4,7 +4,7 @@
 /*    $Id$       */
 /*    Version: $Name$                                          */
 /*                                                                */
-/*    Copyright (C) 2000, 2004, 2005 by the deal.II authors */
+/*    Copyright (C) 2000, 2004, 2005, 2006 by the deal.II authors */
 /*                                                                */
 /*    This file is subject to QPL and may not be  distributed     */
 /*    without copyright and license information. Please refer     */
@@ -1477,10 +1477,8 @@ namespace QuasiStaticElasticity
     system_matrix = 0;
 
     FEValues<dim> fe_values (fe, quadrature_formula, 
-                            UpdateFlags(update_values    |
-                                        update_gradients |
-                                        update_q_points  |
-                                        update_JxW_values));
+                            update_values   | update_gradients |
+                             update_q_points | update_JxW_values);
 
     const unsigned int   dofs_per_cell = fe.dofs_per_cell;
     const unsigned int   n_q_points    = quadrature_formula.n_quadrature_points;
index cd22898d8b32cd6c39662bb79ced1b8502446509..9186a912cb2071fd624febf71b99cd08ee0aa967 100644 (file)
@@ -4,7 +4,7 @@
 /*    $Id$       */
 /*    Version: $Name$                                          */
 /*                                                                */
-/*    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 by the deal.II authors */
+/*    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors */
 /*                                                                */
 /*    This file is subject to QPL and may not be  distributed     */
 /*    without copyright and license information. Please refer     */
@@ -470,10 +470,8 @@ void LaplaceProblem<dim>::assemble_system ()
                                   // giving it the update_q_points
                                   // flag:
   FEValues<dim> fe_values (fe, quadrature_formula, 
-                          UpdateFlags(update_values    |
-                                      update_gradients |
-                                      update_q_points  |
-                                      update_JxW_values));
+                          update_values    | update_gradients |
+                           update_q_points  | update_JxW_values);
 
                                   // Note that the following numbers
                                   // depend on the dimension which we
index 35ff4bd5ba0946cdbeea2bf98cc6a10072982f63..f8408165526855d456f8530a53784c130ae8675d 100644 (file)
@@ -789,18 +789,18 @@ void DGMethod<dim>::assemble_system1 ()
                                   // ``UpdateFlags'' for the
                                   // ``FEValues'' and the
                                   // ``FEFaceValues'' objects.
-  UpdateFlags update_flags = update_values
-                            | update_gradients
-                            | update_q_points
-                            | update_JxW_values;
+  const UpdateFlags update_flags = update_values
+                                   | update_gradients
+                                   | update_q_points
+                                   | update_JxW_values;
 
                                   // Note, that on faces we do not
                                   // need gradients but we need
                                   // normal vectors.
-  UpdateFlags face_update_flags = update_values
-                                 | update_q_points
-                                 | update_JxW_values
-                                 | update_normal_vectors;
+  const UpdateFlags face_update_flags = update_values
+                                        | update_q_points
+                                        | update_JxW_values
+                                        | update_normal_vectors;
   
                                   // On the neighboring cell we only
                                   // need the shape values. Given a
@@ -810,7 +810,7 @@ void DGMethod<dim>::assemble_system1 ()
                                   // the normal vectors are known to
                                   // be the negative of the normal
                                   // vectors of the current cell.
-  UpdateFlags neighbor_face_update_flags = update_values;
+  const UpdateFlags neighbor_face_update_flags = update_values;
    
                                   // Then we create the ``FEValues''
                                   // object. Note, that since version
@@ -1305,17 +1305,17 @@ void DGMethod<dim>::assemble_system1 ()
 template <int dim>
 void DGMethod<dim>::assemble_system2 () 
 {
-  UpdateFlags update_flags = update_values
-                            | update_gradients
-                            | update_q_points
-                            | update_JxW_values;
+  const UpdateFlags update_flags = update_values
+                                   | update_gradients
+                                   | update_q_points
+                                   | update_JxW_values;
   
-  UpdateFlags face_update_flags = update_values
-                                 | update_q_points
-                                 | update_JxW_values
-                                 | update_normal_vectors;
+  const UpdateFlags face_update_flags = update_values
+                                        | update_q_points
+                                        | update_JxW_values
+                                        | update_normal_vectors;
   
-  UpdateFlags neighbor_face_update_flags = update_values;
+  const UpdateFlags neighbor_face_update_flags = update_values;
 
                                   // Here we do not need
                                   // ``fe_v_face_neighbor'' as case 4
index 175a77ac7d131d27c1608b8382bdc88d5e2c3ec0..e64365bb9e99cec92dce49dce148cc13787d830e 100644 (file)
@@ -4,7 +4,7 @@
 /*    $Id$       */
 /*    Version: $Name$                                          */
 /*                                                                */
-/*    Copyright (C) 2000, 2001, 2002, 2003, 2004 by the deal.II authors */
+/*    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2006 by the deal.II authors */
 /*                                                                */
 /*    This file is subject to QPL and may not be  distributed     */
 /*    without copyright and license information. Please refer     */
@@ -806,10 +806,8 @@ void LaplaceProblem<dim>::assemble_system ()
                                   // cell) to evaluate the right hand
                                   // side function.
   FEValues<dim>  fe_values (*fe, quadrature_formula, 
-                           UpdateFlags(update_values    |
-                                       update_gradients |
-                                       update_q_points  |
-                                       update_JxW_values));
+                           update_values   | update_gradients |
+                            update_q_points | update_JxW_values);
 
                                   // For the face integrals, we only
                                   // need the values of the shape
@@ -821,10 +819,8 @@ void LaplaceProblem<dim>::assemble_system ()
                                   // from the exact solution object
                                   // (see below).
   FEFaceValues<dim> fe_face_values (*fe, face_quadrature_formula, 
-                                   UpdateFlags(update_values         |
-                                               update_q_points       |
-                                               update_normal_vectors |
-                                               update_JxW_values));
+                                   update_values         | update_q_points  |
+                                    update_normal_vectors | update_JxW_values);
 
                                   // In order to make programming
                                   // more readable below, we alias
index bd23075d1ef02dfa07015d11f4cba072b8d681bc..8fe13b97b399db8d55be9ab86cd8d24194be0c07 100644 (file)
@@ -4,7 +4,7 @@
 /*    $Id$       */
 /*    Version: $Name$                                          */
 /*                                                                */
-/*    Copyright (C) 2000, 2001, 2002, 2003, 2004 by the deal.II authors */
+/*    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2006 by the deal.II authors */
 /*                                                                */
 /*    This file is subject to QPL and may not be  distributed     */
 /*    without copyright and license information. Please refer     */
@@ -447,10 +447,8 @@ void ElasticProblem<dim>::assemble_system ()
                                   // where they are precomputed upon
                                   // construction).
   FEValues<dim> fe_values (fe, quadrature_formula, 
-                          UpdateFlags(update_values    |
-                                      update_gradients |
-                                      update_q_points  |
-                                      update_JxW_values));
+                          update_values   | update_gradients |
+                           update_q_points | update_JxW_values);
 
                                   // The number of degrees of freedom
                                   // per cell we now obviously ask
index 173d0fcc097ef87b6991901b67c8e2753ab113bd..424f86694beda40f0ace18f411ec2963cf9fb233 100644 (file)
@@ -4,7 +4,7 @@
 /*    $Id$       */
 /*    Version: $Name$                                          */
 /*                                                                */
-/*    Copyright (C) 2000, 2001, 2002, 2003, 2004 by the deal.II authors */
+/*    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2006 by the deal.II authors */
 /*                                                                */
 /*    This file is subject to QPL and may not be  distributed     */
 /*    without copyright and license information. Please refer     */
@@ -988,15 +988,11 @@ assemble_system_interval (const typename DoFHandler<dim>::active_cell_iterator &
                                   // gradients, but rather the normal
                                   // vectors to the cells.
   FEValues<dim> fe_values (fe, quadrature_formula, 
-                          UpdateFlags(update_values    |
-                                      update_gradients |
-                                      update_q_points  |
-                                      update_JxW_values));
+                          update_values   | update_gradients |
+                           update_q_points | update_JxW_values);
   FEFaceValues<dim> fe_face_values (fe, face_quadrature_formula,
-                                   UpdateFlags (update_values     |
-                                                update_q_points   |
-                                                update_JxW_values |
-                                                update_normal_vectors));
+                                   update_values     | update_q_points   |
+                                    update_JxW_values | update_normal_vectors);
 
                                   // Then we define some
                                   // abbreviations to avoid
@@ -1598,8 +1594,7 @@ GradientEstimation::estimate_interval (const DoFHandler<dim> &dof_handler,
   QMidpoint<dim> midpoint_rule;
   FEValues<dim>  fe_midpoint_value (dof_handler.get_fe(),
                                    midpoint_rule,
-                                   UpdateFlags(update_values |
-                                               update_q_points));
+                                   update_values | update_q_points);
   
                                   // Then we need space foe the
                                   // tensor ``Y'', which is the sum

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.