]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Rename FullMatrix::clear to FullMatrix::set_zero.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 11 May 2004 18:15:49 +0000 (18:15 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 11 May 2004 18:15:49 +0000 (18:15 +0000)
git-svn-id: https://svn.dealii.org/trunk@9237 0785d39b-7218-0410-832d-ea1e28bc413d

32 files changed:
deal.II/deal.II/source/fe/fe_system.cc
deal.II/deal.II/source/fe/fe_tools.cc
deal.II/deal.II/source/numerics/derivative_approximation.cc
deal.II/deal.II/source/numerics/matrices.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-3/step-3.cc
deal.II/examples/step-4/step-4.cc
deal.II/examples/step-5/step-5.cc
deal.II/examples/step-6/step-6.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
deal.II/lac/include/lac/block_matrix_array.h
deal.II/lac/include/lac/full_matrix.h
deal.II/lac/include/lac/precondition_block.templates.h
deal.II/lac/include/lac/sparse_matrix_ez.h
tests/bits/apply_boundary_values_01.cc
tests/bits/apply_boundary_values_02.cc
tests/bits/dof_constraints_01.cc
tests/bits/dof_constraints_03.cc
tests/bits/dof_constraints_09.cc
tests/bits/petsc_63.cc
tests/deal.II/block_matrices.cc
tests/deal.II/wave-test-3.cc
tests/fe/non_primitive_1.cc
tests/fe/non_primitive_2.cc
tests/lac/full_matrix.cc

index 00726f38588a5067a8c9b9e18ba5de5ffa517705..cb52c8387fe8de5cd0959d5ead01e61edf05d5c3 100644 (file)
@@ -519,7 +519,7 @@ get_interpolation_matrix (const FiniteElementBase<dim> &x_source_fe,
                                    // couple different bases (or
                                    // multiplicity indices) are really
                                    // zero. then assign entries
-  interpolation_matrix.clear ();
+  interpolation_matrix.set_zero ();
   for (unsigned int i=0; i<this->dofs_per_cell; ++i)
     for (unsigned int j=0; j<source_fe.dofs_per_cell; ++j)
       if (this->system_to_base_table[i].first ==
index 5cf64539cfa99bd9120cd0d4e874c34bd2e4b2f1..196b4c70ea5c4f3ac449a199f069315a6c282945 100644 (file)
@@ -323,7 +323,7 @@ void FETools::get_projection_matrix (const FiniteElement<dim> &fe1,
         ExcMatrixDimensionMismatch(matrix.m(), matrix.n(),
                                    fe2.dofs_per_cell,
                                    fe1.dofs_per_cell));
-  matrix.clear();
+  matrix.set_zero();
   
   unsigned int n1 = fe1.dofs_per_cell;
   unsigned int n2 = fe2.dofs_per_cell;
index b7e9509d588f7a6661b51c67a6a2276e769581e0..d569fcc80d535609a53fe4c5481ff9fb964c9289 100644 (file)
@@ -696,14 +696,14 @@ DerivativeApproximation::approximate (const Mapping<dim>    &mapping,
       DerivativeDescription::symmetrize (projected_derivative);
       
                                        // compute Y^-1 g
-      typename DerivativeDescription::Derivative derivative;
-      Tensor<2,dim> Y_inverse = invert(Y);
+      const Tensor<2,dim> Y_inverse = invert(Y);
       
+      typename DerivativeDescription::Derivative derivative;
       contract (derivative, Y_inverse, projected_derivative);
 
       *derivative_norm_on_this_cell
        = DerivativeDescription::derivative_norm (derivative);
-    };
+    }
 }
 
 
index a501dbecbf78b8ada3bc2cd493771f2bed50fcc8..708d767cbba7f2811cbaa26e01e3fa1c8c495483 100644 (file)
@@ -137,7 +137,7 @@ void MatrixCreator::create_mass_matrix_1 (const Mapping<dim>       &mapping,
     {
       fe_values.reinit (cell);
       
-      cell_matrix.clear ();
+      cell_matrix.set_zero ();
       cell->get_dof_indices (dof_indices);
       
       if (coefficient != 0)
@@ -325,7 +325,7 @@ MatrixCreator::create_mass_matrix_2 (const Mapping<dim>       &mapping,
     {
       fe_values.reinit (cell);
       
-      cell_matrix.clear ();
+      cell_matrix.set_zero ();
       local_rhs = 0;
       cell->get_dof_indices (dof_indices);
       
@@ -583,7 +583,7 @@ create_boundary_mass_matrix_1 (const Mapping<dim>        &mapping,
       if (boundary_functions.find(cell->face(face)->boundary_indicator()) !=
          boundary_functions.end())
        {
-         cell_matrix.clear ();
+         cell_matrix.set_zero ();
          cell_vector = 0;
          
          fe_values.reinit (cell, face);
@@ -959,7 +959,7 @@ void MatrixCreator::create_laplace_matrix_1 (const Mapping<dim>       &mapping,
     {
       fe_values.reinit (cell);
       
-      cell_matrix.clear ();
+      cell_matrix.set_zero ();
       cell->get_dof_indices (dof_indices);
       
       if (coefficient != 0)
@@ -1150,7 +1150,7 @@ MatrixCreator::create_laplace_matrix_2 (const Mapping<dim>       &mapping,
     {
       fe_values.reinit (cell);
       
-      cell_matrix.clear ();
+      cell_matrix.set_zero ();
       local_rhs = 0;
       cell->get_dof_indices (dof_indices);
       
index 40b388d51eb7c400c89e0786b911b329435cd93b..5888a8d8e825b66afa506231c7a1979259ca001a 100644 (file)
@@ -836,7 +836,7 @@ void DGMethod<dim>::assemble_system1 ()
                                       // ``u_v_matrix'' and
                                       // ``cell_vector'' to zero,
                                       // before assembling the cell terms.
-      u_v_matrix.clear ();
+      u_v_matrix.set_zero ();
       cell_vector = 0;
       
                                       // Now we reinit the ``FEValues''
@@ -869,7 +869,7 @@ void DGMethod<dim>::assemble_system1 ()
                                           // and clear the
                                           // ``un_v_matrix'' on each
                                           // face.
-         un_v_matrix.clear();
+         un_v_matrix.set_zero();
                  
                                           // Now we distinguish the
                                           // four different cases in
@@ -992,7 +992,7 @@ void DGMethod<dim>::assemble_system1 ()
                                                       // different
                                                       // neighboring
                                                       // cells.
-                     un_v_matrix.clear();
+                     un_v_matrix.set_zero();
                      
                                                       // As already
                                                       // mentioned
@@ -1270,7 +1270,7 @@ void DGMethod<dim>::assemble_system2 ()
     endc = dof_handler.end();
   for (;cell!=endc; ++cell) 
     {
-      u_v_matrix.clear ();
+      u_v_matrix.set_zero ();
       cell_vector = 0;
 
       fe_v.reinit (cell);
@@ -1317,9 +1317,9 @@ void DGMethod<dim>::assemble_system2 ()
                              ExcInternalError());
                      Assert (!neighbor_child->has_children(), ExcInternalError());
                      
-                     un_v_matrix.clear();
-                     u_vn_matrix.clear();
-                     un_vn_matrix.clear();
+                     un_v_matrix.set_zero();
+                     u_vn_matrix.set_zero();
+                     un_vn_matrix.set_zero();
                      
                      fe_v_subface.reinit (cell, face_no, subface_no);
                      fe_v_face_neighbor.reinit (neighbor_child, neighbor2);
@@ -1355,9 +1355,9 @@ void DGMethod<dim>::assemble_system2 ()
                    {
                      const unsigned int neighbor2=cell->neighbor_of_neighbor(face_no);
                      
-                     un_v_matrix.clear();
-                     u_vn_matrix.clear();
-                     un_vn_matrix.clear();
+                     un_v_matrix.set_zero();
+                     u_vn_matrix.set_zero();
+                     un_vn_matrix.set_zero();
                      
                      fe_v_face.reinit (cell, face_no);
                      fe_v_face_neighbor.reinit (neighbor, neighbor2);
index 4d1c8cc4ca3cd8aa24f9c0b2c368770a98956e1a..b37c0e7bde9bcbc0cd8302228c2752671e4a35f2 100644 (file)
@@ -1289,7 +1289,7 @@ namespace LaplaceSolver
     for (typename DoFHandler<dim>::active_cell_iterator cell=begin_cell;
         cell!=end_cell; ++cell)
       {
-       cell_matrix.clear ();
+       cell_matrix.set_zero ();
 
        fe_values.reinit (cell);
 
index 8b31ac182db90878824654fb266b4435422fffad..cd9906891d200ea5862d6f29f9c039e939aaff30 100644 (file)
@@ -704,7 +704,7 @@ namespace LaplaceSolver
     for (typename DoFHandler<dim>::active_cell_iterator cell=begin_cell;
         cell!=end_cell; ++cell)
       {
-       cell_matrix.clear ();
+       cell_matrix.set_zero ();
 
        fe_values.reinit (cell);
 
index fa8a5ed0cca76c1d1bda1404ae57e93e07f8e858..385cc70586b7fc5661495bacd99b82acb7b3b4f2 100644 (file)
@@ -100,7 +100,7 @@ double gradient_power (const Tensor<1,dim> &v,
   Assert ((n/2)*2 == n, ExcMessage ("Value of 'n' must be even"));
   double p = 1;
   for (unsigned int k=0; k<n; k+=2)
-    p += (v*v);
+    p *= (v*v);
   return p;
 }
 
@@ -463,7 +463,7 @@ void MinimizationProblem<dim>::assemble_step ()
                                        // First, clear the objects that hold
                                        // the local matrix and right hand side
                                        // contributions for this cell:
-      cell_matrix.clear ();
+      cell_matrix.set_zero ();
       cell_rhs = 0;
 
                                        // Then initialize the values and
@@ -699,7 +699,7 @@ MinimizationProblem<dim>::line_search (const Vector<double> &update) const
     {
                                        // At the present location, which is
                                        // ``present_solution+alpha*update'',
-                                       // evaluate the energy"
+                                       // evaluate the energy
       tmp = present_solution;
       tmp.add (alpha, update);
       const double f_a = energy (dof_handler, tmp);
index db9efb23775634f6b2d48ae7f70d38ffe2d24bf7..e868c737227998404ad2da89b9dbdbaac24066b8 100644 (file)
@@ -214,7 +214,7 @@ void LaplaceProblem<dim>::assemble_system ()
                                                 endc = mg_dof_handler.end();
   for (; cell!=endc; ++cell)
     {
-      cell_matrix.clear ();
+      cell_matrix.set_zero ();
       cell_rhs = 0;
 
                                       // As before, we want the
@@ -324,7 +324,7 @@ void LaplaceProblem<dim>::assemble_multigrid ()
                                       // Remember the level of the
                                       // current cell.
       const unsigned int level = cell->level();
-      cell_matrix.clear ();
+      cell_matrix.set_zero ();
 
                                       // Compute the values specified
                                       // by update flags above.
index 4eee20ff95f7478da15bc153db19d25bbf96254e..cdae53c9b9559923143b42a6a8bf40416931a214 100644 (file)
@@ -564,7 +564,7 @@ void ElasticProblem<dim>::assemble_system ()
   for (; cell!=endc; ++cell)
     if (cell->subdomain_id() == this_mpi_process)
       {
-        cell_matrix.clear ();
+        cell_matrix.set_zero ();
         cell_rhs = 0;
 
         fe_values.reinit (cell);
index 0e6152cbde67c14bd32acba25e010eec2d80f88a..464f596f8e7d8ef3c6e880fe9adcd5e42210b90e 100644 (file)
@@ -481,7 +481,7 @@ void LaplaceProblem::assemble_system ()
                                       // to global matrix and global
                                       // right hand side to zero,
                                       // before we fill them.
-      cell_matrix.clear ();
+      cell_matrix.set_zero ();
       cell_rhs = 0;
 
                                       // Assemble the matrix: For the
index 4f9458703fdfa7f894d39b0f0710725a23edad06..6cded3bd7f85b86d138719d65a36487f058c878d 100644 (file)
@@ -406,7 +406,7 @@ void LaplaceProblem<dim>::assemble_system ()
   for (; cell!=endc; ++cell)
     {
       fe_values.reinit (cell);
-      cell_matrix.clear ();
+      cell_matrix.set_zero ();
       cell_rhs = 0;
 
                                       // Now we have to assemble the
index f83be3f3272e47cdc01ffc95b12099264a03305d..fa9d1a2ea6efe0bed7bfd7eb897e41649ff01a48 100644 (file)
@@ -428,7 +428,7 @@ void LaplaceProblem<dim>::assemble_system ()
                                                 endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     {
-      cell_matrix.clear ();
+      cell_matrix.set_zero ();
       cell_rhs = 0;
 
                                       // As before, we want the
index 35f1494a30c81290672f4a5a1bce108d78182cdb..431370c6d20ef2cadf103594551941fb28b25a78 100644 (file)
@@ -509,7 +509,7 @@ void LaplaceProblem<dim>::assemble_system ()
                                                 endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     {
-      cell_matrix.clear ();
+      cell_matrix.set_zero ();
       cell_rhs = 0;
 
       fe_values.reinit (cell);
index c577f0b0a89730e1f558a50f240d378969229a52..6362ceb7c202e3c25b9128e91d176892036e6467 100644 (file)
@@ -878,7 +878,7 @@ void LaplaceProblem<dim>::assemble_system ()
                                                 endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     {
-      cell_matrix.clear ();
+      cell_matrix.set_zero ();
       cell_rhs = 0;
 
       fe_values.reinit (cell);
index 47461207376fd13f2552a327a5c0f7b61605dad6..5ddb46cfbbb41efee86c15daaebad931fb897ad6 100644 (file)
@@ -517,7 +517,7 @@ void ElasticProblem<dim>::assemble_system ()
                                                 endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     {
-      cell_matrix.clear ();
+      cell_matrix.set_zero ();
       cell_rhs = 0;
 
       fe_values.reinit (cell);
index c48a953381b2acdf066042489c0f28fde4f4b147..75b5257ac765dedffcafcbc58a98565bda5a61f6 100644 (file)
@@ -1035,7 +1035,7 @@ assemble_system_interval (const typename DoFHandler<dim>::active_cell_iterator &
     {
                                       // First clear old contents of
                                       // the cell contributions...
-      cell_matrix.clear ();
+      cell_matrix.set_zero ();
       cell_rhs = 0;
 
                                       // ... then initialize
index 829d06af593593701d00d7061792a8a7d5541a53..7668069b8f82143bfe1845d8961bc6046ae3f85c 100644 (file)
@@ -81,7 +81,8 @@ class BlockMatrixArray : public Subscriptor
                bool transpose = false);
 
                                     /**
-                                     * Delete all entries
+                                     * Delete all entries, i.e. reset
+                                     * the matrix to an empty state.
                                      */
     void clear();
     
index 4589cdfc4f0b10a1c4dfc2bda3c65ccdb365a879..dd44ad0256fbb98e025f41954d84cb9215c98d38 100644 (file)
@@ -373,6 +373,13 @@ class FullMatrix : public Table<2,number>
                                      * Final iterator of row <tt>r</tt>.
                                      */
     const_iterator end (const unsigned int r) const;
+
+                                    /**
+                                     * Set all entries to zero, but
+                                     * do not change the size of the
+                                     * matrix.
+                                     */
+    void set_zero ();
     
                                     /**
                                      * Scale the entire matrix by a
@@ -976,6 +983,9 @@ class FullMatrix : public Table<2,number>
     DeclException0 (ExcSourceEqualsDestination);
 
     friend class Accessor;
+
+  private:
+    void clear ();
 };
 
 /*@}*/
@@ -985,7 +995,8 @@ class FullMatrix : public Table<2,number>
 
 
 template <typename number>
-inline unsigned int
+inline
+unsigned int
 FullMatrix<number>::m() const
 {
   return this->n_rows();
@@ -994,13 +1005,25 @@ FullMatrix<number>::m() const
 
 
 template <typename number>
-inline unsigned int
+inline
+unsigned int
 FullMatrix<number>::n() const
 {
   return this->n_cols();
 }
 
 
+
+template <typename number>
+void
+FullMatrix<number>::set_zero ()
+{
+  if (this->n_elements() != 0)
+    std::fill_n (this->val, this->n_elements(), number());
+}
+
+
+
 template <typename number>
 template <typename number2>
 inline
@@ -1009,6 +1032,8 @@ void FullMatrix<number>::fill (const number2* src)
   Table<2,number>::fill(src);
 }
 
+
+
 template <typename number>
 template <class MATRIX>
 void
index 4f34759200f7e710ff48af7784ad30172ba87fb0..84e1e734a4d73ffeb1d8faacd4ab7db5df81ee6e 100644 (file)
@@ -207,7 +207,7 @@ void PreconditionBlock<MATRIX,inverse_type>::invert_diagblocks()
                                           // soon as possible
        };
 
-      M_cell.clear ();
+      M_cell.set_zero ();
       
       for (unsigned int cell=0; cell<nblocks; ++cell)
        {
index c86939a151f15d0754b9b6e68dddccb968fe1651..187430774d5fadc9354243217024a96ce5872b0c 100644 (file)
@@ -411,8 +411,7 @@ class SparseMatrixEZ : public Subscriptor
                                      * to a state just like after
                                      * having called the default
                                      * constructor. It also forgets
-                                     * the sparsity pattern it was
-                                     * previously tied to.
+                                     * its sparsity pattern.
                                      */
     void clear ();
     
index a08ffe813bb798fe20a620d03008349c41df795c..e2f96387513d8b23fc9e6be256403806f3dda61d 100644 (file)
@@ -94,7 +94,7 @@ void test ()
        cell != dof_handler.end(); ++cell)
     {
       cell->get_dof_indices (local_dofs);
-      local_matrix.clear ();
+      local_matrix.set_zero ();
       for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
         for (unsigned int j=0; j<fe.dofs_per_cell; ++j)
           local_matrix(i,j) = (i+1.)*(j+1.)*(local_dofs[i]+1.)*(local_dofs[j]+1.);
index a024e17665d9df33526419bf94ee496a1066d0df..63a98f84f336c2b744b5dedcb4e550f5527b9310 100644 (file)
@@ -94,7 +94,7 @@ void test ()
        cell != dof_handler.end(); ++cell)
     {
       cell->get_dof_indices (local_dofs);
-      local_matrix.clear ();
+      local_matrix.set_zero ();
       for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
         for (unsigned int j=0; j<fe.dofs_per_cell; ++j)
           local_matrix(i,j) = (i+1.)*(j+1.)*(local_dofs[i]+1.)*(local_dofs[j]+1.);
index ea387b6adc9fd603343f0fd1b82578011e2b4749..c9c0a924263ea33001ed5e513befd1eb72c913c0 100644 (file)
@@ -88,7 +88,7 @@ void test ()
        cell != dof_handler.end(); ++cell)
     {
       cell->get_dof_indices (local_dofs);
-      local_matrix.clear ();
+      local_matrix.set_zero ();
       for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
         for (unsigned int j=0; j<fe.dofs_per_cell; ++j)
           local_matrix(i,j) = (i+1.)*(j+1.)*(local_dofs[i]+1.)*(local_dofs[j]+1.);
index a0f1b464a0da9b2e1265bffde2bdb32a25a85a07..613f1306d53c4f6753f81e88fb59e85cdabbf55f 100644 (file)
@@ -80,7 +80,7 @@ void test ()
        cell != dof_handler.end(); ++cell)
     {
       cell->get_dof_indices (local_dofs);
-      local_matrix.clear ();
+      local_matrix.set_zero ();
       for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
         for (unsigned int j=0; j<fe.dofs_per_cell; ++j)
           local_matrix(i,j) = (i+1.)*(j+1.)*(local_dofs[i]+1.)*(local_dofs[j]+1.);
index 5467bab6834d2b835e3f3f875923ca31f16d8f0b..1b94848d144384ad64b7af4d9b25787929966d54 100644 (file)
@@ -88,7 +88,7 @@ void test ()
        cell != dof_handler.end(); ++cell)
     {
       cell->get_dof_indices (local_dofs);
-      local_matrix.clear ();
+      local_matrix.set_zero ();
       for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
         for (unsigned int j=0; j<fe.dofs_per_cell; ++j)
           local_matrix(i,j) = (i+1.)*(j+1.)*(local_dofs[i]+1.)*(local_dofs[j]+1.);
index d3ddd2bcd4eb633613d168a80a0be9ba807961a6..9d07e3e11d149f8555638c832e303e8afd36f317 100644 (file)
@@ -12,7 +12,7 @@
 //----------------------------  petsc_63.cc  ---------------------------
 
 
-// PETScWrappers::SparseMatrix::reinit () was declared but not defined
+// PETScWrappers::SparseMatrix::set_zero () was declared but not defined
 
 #include "../tests.h"
 #include <lac/petsc_sparse_matrix.h>
@@ -28,7 +28,7 @@ void test (PETScWrappers::MatrixBase &m)
   Assert (m.m() == 100, ExcInternalError());
   Assert (m.n() == 100, ExcInternalError());
 
-  m.reinit ();
+  m.set_zero ();
   
   Assert (m.m() == 100, ExcInternalError());
   Assert (m.n() == 100, ExcInternalError());
index 6c133ef6075b1e9dee55ba14fa13aa2cc3942125..8f364fdd08322753b3c0bfad7ba2032506cbbdde 100644 (file)
@@ -276,7 +276,7 @@ void LaplaceProblem<Vector,Matrix,Sparsity>::assemble_system ()
     {
       fe_values.reinit (cell);
 
-      cell_matrix.clear ();
+      cell_matrix.set_zero ();
       cell_rhs = 0;
 
       for (unsigned int i=0; i<dofs_per_cell; ++i)
index b583562704a5bb38fe46de96dbc4cd9f6aacf0e6..f0402986e3479fd1e4f1f68d0aa8acfc841521c6 100644 (file)
@@ -2413,7 +2413,7 @@ double EvaluateEnergyContent<dim>::compute_energy (const PartOfDomain pod) const
       cell->get_dof_values (*this->u, local_u);
       cell->get_dof_values (*this->v, local_v);
 
-      cell_matrix.clear ();
+      cell_matrix.set_zero ();
       this->density->value_list (fe_values.get_quadrature_points(),
                           density_values);
       for (unsigned int point=0; point<fe_values.n_quadrature_points; ++point)
@@ -2426,7 +2426,7 @@ double EvaluateEnergyContent<dim>::compute_energy (const PartOfDomain pod) const
 
       total_energy += 1./2. * cell_matrix.matrix_norm_square (local_v);
 
-      cell_matrix.clear ();
+      cell_matrix.set_zero ();
       this->stiffness->value_list (fe_values.get_quadrature_points(),
                             stiffness_values);
       for (unsigned int point=0; point<fe_values.n_quadrature_points; ++point)
@@ -4772,8 +4772,8 @@ FEValues<dim>  fe_values (fe, quadrature,
        cell != dof_handler->end(); ++cell)
     {
       fe_values.reinit (cell);
-      cell_mass_matrix.clear ();
-      cell_laplace_matrix.clear ();
+      cell_mass_matrix.set_zero ();
+      cell_laplace_matrix.set_zero ();
       cell->get_dof_indices (dof_indices_on_cell);
 
       if (!density_constant || !stiffness_constant)
@@ -5280,7 +5280,7 @@ TimeStep_Dual<dim>::build_rhs (const typename DoFHandler<dim>::cell_iterator &ol
       old_cell->get_dof_values (previous_time_level.u, tmp);
       cell_matrix.vmult (local_M_u, tmp);
 
-      cell_matrix.clear ();
+      cell_matrix.set_zero ();
       std::vector<double> stiffness_values(fe_values.n_quadrature_points);
       this->parameters.stiffness->value_list (fe_values.get_quadrature_points(),
                                        stiffness_values);
@@ -5396,7 +5396,7 @@ TimeStep_Dual<dim>::collect_from_children (const typename DoFHandler<dim>::cell_
          old_child->get_dof_values (previous_time_level.u, local_old_dof_values_u);
          old_child->get_dof_values (previous_time_level.v, local_old_dof_values_v);
 
-         cell_matrix.clear ();
+         cell_matrix.set_zero ();
          std::vector<double> density_values(fe_values.n_quadrature_points);
          this->parameters.density->value_list (fe_values.get_quadrature_points(),
                                          density_values);
@@ -5411,7 +5411,7 @@ TimeStep_Dual<dim>::collect_from_children (const typename DoFHandler<dim>::cell_
          cell_matrix.vmult (local_M_u, local_old_dof_values_u);
          cell_matrix.vmult (local_M_v, local_old_dof_values_v);
 
-         cell_matrix.clear ();
+         cell_matrix.set_zero ();
          std::vector<double> stiffness_values(fe_values.n_quadrature_points);
          this->parameters.stiffness->value_list (fe_values.get_quadrature_points(),
                                                stiffness_values);
@@ -5493,7 +5493,7 @@ TimeStep_Dual<dim>::distribute_to_children (const typename DoFHandler<dim>::cell
       else
        {
          fe_values.reinit (new_child);
-         cell_matrix.clear ();
+         cell_matrix.set_zero ();
          std::vector<double> density_values(fe_values.n_quadrature_points);
          this->parameters.density->value_list (fe_values.get_quadrature_points(),
                                          density_values);
@@ -5508,7 +5508,7 @@ TimeStep_Dual<dim>::distribute_to_children (const typename DoFHandler<dim>::cell
          cell_matrix.vmult (local_M_u, local_old_dof_values_u);
          cell_matrix.vmult (local_M_v, local_old_dof_values_v);
 
-         cell_matrix.clear ();
+         cell_matrix.set_zero ();
          std::vector<double> stiffness_values(fe_values.n_quadrature_points);
          this->parameters.stiffness->value_list (fe_values.get_quadrature_points(),
                                            stiffness_values);
@@ -7030,7 +7030,7 @@ TimeStep_Primal<dim>::build_rhs (const typename DoFHandler<dim>::cell_iterator &
       old_cell->get_dof_values (previous_time_level.v, tmp);
       cell_matrix.vmult (local_M_v, tmp);
 
-      cell_matrix.clear ();
+      cell_matrix.set_zero ();
       std::vector<double> stiffness_values(fe_values.n_quadrature_points);
       this->parameters.stiffness->value_list (fe_values.get_quadrature_points(),
                                            stiffness_values);
@@ -7150,7 +7150,7 @@ FullMatrix<double>   cell_matrix (dofs_per_cell, dofs_per_cell);
          old_child->get_dof_values (previous_time_level.u, local_old_dof_values_u);
          old_child->get_dof_values (previous_time_level.v, local_old_dof_values_v);
       
-         cell_matrix.clear ();
+         cell_matrix.set_zero ();
          std::vector<double> density_values(fe_values.n_quadrature_points);
          this->parameters.density->value_list (fe_values.get_quadrature_points(),
                                          density_values);
@@ -7165,7 +7165,7 @@ FullMatrix<double>   cell_matrix (dofs_per_cell, dofs_per_cell);
          cell_matrix.vmult (local_M_u, local_old_dof_values_u);
          cell_matrix.vmult (local_M_v, local_old_dof_values_v);
       
-         cell_matrix.clear ();
+         cell_matrix.set_zero ();
 
          std::vector<double> stiffness_values(fe_values.n_quadrature_points);
          this->parameters.stiffness->value_list (fe_values.get_quadrature_points(),
@@ -7248,7 +7248,7 @@ TimeStep_Primal<dim>::distribute_to_children (const typename DoFHandler<dim>::ce
       else
        {
          fe_values.reinit (new_child);
-         cell_matrix.clear ();
+         cell_matrix.set_zero ();
          std::vector<double> density_values(fe_values.n_quadrature_points);
          this->parameters.density->value_list (fe_values.get_quadrature_points(),
                                              density_values);
@@ -7263,7 +7263,7 @@ TimeStep_Primal<dim>::distribute_to_children (const typename DoFHandler<dim>::ce
          cell_matrix.vmult (local_M_u, local_old_dof_values_u);
          cell_matrix.vmult (local_M_v, local_old_dof_values_v);
 
-         cell_matrix.clear ();
+         cell_matrix.set_zero ();
          std::vector<double> stiffness_values(fe_values.n_quadrature_points);
          this->parameters.stiffness->value_list (fe_values.get_quadrature_points(),
                                                stiffness_values);
index 781b740d0ec02718a16d5be8899ada22c60aba0a..1bc3c4bb343986766502bba394cf7306c1224d3a 100644 (file)
@@ -68,7 +68,7 @@ create_stokes_matrix_1 (const DoFHandler<dim> &dof_handler,
   
   for (; cell!=endc; ++cell)
     {
-      local_matrix.clear ();
+      local_matrix.set_zero ();
       fe_values.reinit (cell);
 
       for (unsigned int i=0; i<dofs_per_cell; ++i)
@@ -141,7 +141,7 @@ create_stokes_matrix_2 (const DoFHandler<dim> &dof_handler,
   
   for (; cell!=endc; ++cell)
     {
-      local_matrix.clear ();
+      local_matrix.set_zero ();
       fe_values.reinit (cell);
       for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
        for (unsigned int comp_i=0; comp_i<fe.n_components(); ++comp_i)
@@ -217,7 +217,7 @@ create_stokes_matrix_3 (const DoFHandler<dim> &dof_handler,
   
   for (; cell!=endc; ++cell)
     {
-      local_matrix.clear ();
+      local_matrix.set_zero ();
       fe_values.reinit (cell);
       for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
        for (unsigned int comp_i=0; comp_i<fe.n_components(); ++comp_i)
index 7b1e9d309b508b42eb1ecb0c7d753afb4989ae28..c75282dc1e02a8a862b66d7dda3256d9f76ccc5e 100644 (file)
@@ -70,7 +70,7 @@ create_stokes_matrix_2 (const DoFHandler<dim> &dof_handler,
   
   for (; cell!=endc; ++cell)
     {
-      local_matrix.clear ();
+      local_matrix.set_zero ();
       fe_values.reinit (cell);
       for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
        for (unsigned int comp_i=0; comp_i<fe.n_components(); ++comp_i)
@@ -146,7 +146,7 @@ create_stokes_matrix_3 (const DoFHandler<dim> &dof_handler,
   
   for (; cell!=endc; ++cell)
     {
-      local_matrix.clear ();
+      local_matrix.set_zero ();
       fe_values.reinit (cell);
       for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
        for (unsigned int comp_i=0; comp_i<fe.n_components(); ++comp_i)
index 9ab49e7b06568d42e3ef6e4dbcefc765da5105fe..6cceef2e2a94809d19ef79c5fe83c06b03b40d8f 100644 (file)
@@ -113,7 +113,7 @@ main ()
       for (unsigned int i=0;i<4;++i)
        {
                                           // Setup rotation matrix
-         C.clear();
+         C.set_zero();
          C.diagadd(1.);
          C(i,i) = C(i+1,i+1) = std::cos(i+1.);
          C(i+1,i) = std::sin(i+1.);

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.