]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Merge from mainline.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 30 Apr 2013 15:18:49 +0000 (15:18 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 30 Apr 2013 15:18:49 +0000 (15:18 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_bigger_global_dof_indices_4@29409 0785d39b-7218-0410-832d-ea1e28bc413d

1  2 
deal.II/examples/step-42/step-42.cc
deal.II/include/deal.II/lac/full_matrix.templates.h
deal.II/include/deal.II/matrix_free/dof_info.h
deal.II/include/deal.II/matrix_free/dof_info.templates.h
deal.II/include/deal.II/matrix_free/fe_evaluation.h
deal.II/include/deal.II/matrix_free/matrix_free.templates.h
deal.II/include/deal.II/numerics/vector_tools.h

Simple merge
index 5e829d4d52224d1475bf63f9e1879cb46135864c,41febef42853ac5a8980541c4f4a4018583021de..a0bbe2ef1fbbc5ddca2cb9639bd89de87924df28
@@@ -594,19 -581,16 +581,16 @@@ void FullMatrix<number>::mmult (FullMat
  
  #endif
  
 -  const unsigned int m = this->m(), n = src.n(), l = this->n();
 +  const size_type m = this->m(), n = src.n(), l = this->n();
  
-   // arrange the loops in a way that
-   // we keep write operations low,
-   // (writing is usually more costly
-   // than reading), even though we
-   // need to access the data in src
-   // not in a contiguous way.
+   // arrange the loops in a way that we keep write operations low, (writing is
+   // usually more costly than reading), even though we need to access the data
+   // in src not in a contiguous way.
 -  for (unsigned int i=0; i<m; i++)
 -    for (unsigned int j=0; j<n; j++)
 +  for (size_type i=0; i<m; i++)
 +    for (size_type j=0; j<n; j++)
        {
          number2 add_value = adding ? dst(i,j) : 0.;
 -        for (unsigned int k=0; k<l; k++)
 +        for (size_type k=0; k<l; k++)
            add_value += (number2)(*this)(i,k) * (number2)(src(k,j));
          dst(i,j) = add_value;
        }
@@@ -682,26 -652,39 +652,39 @@@ void FullMatrix<number>::Tmmult (FullMa
  
  #endif
  
 -  const unsigned int m = n(), n = src.n(), l = this->m();
 +  const size_type m = n(), n = src.n(), l = this->m();
  
-   // arrange the loops in a way that
-   // we keep write operations low,
-   // (writing is usually more costly
-   // than reading), even though we
-   // need to access the data in src
-   // not in a contiguous way. However,
-   // we should usually end up in the
-   // optimized gemm operation in case
-   // the matrix is big, so this
-   // shouldn't be too bad.
-   for (size_type i=0; i<m; i++)
-     for (size_type j=0; j<n; j++)
-       {
-         number2 add_value = adding ? dst(i,j) : 0.;
-         for (size_type k=0; k<l; k++)
-           add_value += (number2)(*this)(k,i) * (number2)(src(k,j));
-         dst(i,j) = add_value;
-       }
+   // symmetric matrix if the two matrices are the same
+   if (PointerComparison::equal(this, &src))
 -    for (unsigned int i=0; i<m; ++i)
 -      for (unsigned int j=i; j<m; ++j)
++    for (size_type i=0; i<m; ++i)
++      for (size_type j=i; j<m; ++j)
+         {
+           number2 add_value = 0.;
 -          for (unsigned int k=0; k<l; ++k)
++          for (size_type k=0; k<l; ++k)
+             add_value += (number2)(*this)(k,i) * (number2)(*this)(k,j);
+           if (adding)
+             {
+               dst(i,j) += add_value;
+               if (i<j)
+                 dst(j,i) += add_value;
+             }
+           else
+             dst(i,j) = dst(j,i) = add_value;
+         }
+   // arrange the loops in a way that we keep write operations low, (writing is
+   // usually more costly than reading), even though we need to access the data
+   // in src not in a contiguous way. However, we should usually end up in the
+   // optimized gemm operation in case the matrix is big, so this shouldn't be
+   // too bad.
+   else
 -    for (unsigned int i=0; i<m; i++)
 -      for (unsigned int j=0; j<n; j++)
++    for (size_type i=0; i<m; i++)
++      for (size_type j=0; j<n; j++)
+         {
+           number2 add_value = adding ? dst(i,j) : 0.;
 -          for (unsigned int k=0; k<l; k++)
++          for (size_type k=0; k<l; k++)
+             add_value += (number2)(*this)(k,i) * (number2)(src(k,j));
+           dst(i,j) = add_value;
+         }
  }
  
  
@@@ -773,20 -742,36 +742,51 @@@ void FullMatrix<number>::mTmult (FullMa
  
  #endif
  
 -  const unsigned int m = this->m(), n = src.m(), l = this->n();
 +  const size_type m = this->m(), n = src.m(), l = this->n();
  
++<<<<<<< .working
 +  // arrange the loops in a way that
 +  // we keep write operations low,
 +  // (writing is usually more costly
 +  // than reading).
 +  for (size_type i=0; i<m; i++)
 +    for (size_type j=0; j<n; j++)
 +      {
 +        number2 add_value = adding ? dst(i,j) : 0.;
 +        for (size_type k=0; k<l; k++)
 +          add_value += (number2)(*this)(i,k) * (number2)(src(j,k));
 +        dst(i,j) = add_value;
 +      }
++=======
+   // symmetric matrix if the two matrices are the same
+   if (PointerComparison::equal(this, &src))
+     for (unsigned int i=0; i<m; ++i)
+       for (unsigned int j=i; j<m; ++j)
+         {
+           number2 add_value = 0.;
+           for (unsigned int k=0; k<l; ++k)
+             add_value += (number2)(*this)(i,k) * (number2)(*this)(j,k);
+           if (adding)
+             {
+               dst(i,j) += add_value;
+               if (i<j)
+                 dst(j,i) += add_value;
+             }
+           else
+             dst(i,j) = dst(j,i) = add_value;
+         }
+   else
+     // arrange the loops in a way that we keep write operations low, (writing is
+     // usually more costly than reading).
+     for (unsigned int i=0; i<m; i++)
+       for (unsigned int j=0; j<n; j++)
+         {
+           number2 add_value = adding ? dst(i,j) : 0.;
+           for (unsigned int k=0; k<l; k++)
+             add_value += (number2)(*this)(i,k) * (number2)(src(j,k));
+           dst(i,j) = add_value;
+         }
++>>>>>>> .merge-right.r29408
  }
  
  
@@@ -858,24 -829,18 +844,18 @@@ void FullMatrix<number>::TmTmult (FullM
  
  #endif
  
 -  const unsigned int m = n(), n = src.m(), l = this->m();
 +  const size_type m = n(), n = src.m(), l = this->m();
  
-   // arrange the loops in a way that
-   // we keep write operations low,
-   // (writing is usually more costly
-   // than reading), even though we
-   // need to access the data in the
-   // calling matrix not in a
-   // contiguous way. However, we
-   // should usually end up in the
-   // optimized gemm operation in case
-   // the matrix is big, so this
-   // shouldn't be too bad.
+   // arrange the loops in a way that we keep write operations low, (writing is
+   // usually more costly than reading), even though we need to access the data
+   // in the calling matrix in a non-contiguous way, possibly leading to cache
+   // misses. However, we should usually end up in the optimized gemm operation
+   // in case the matrix is big, so this shouldn't be too bad.
 -  for (unsigned int i=0; i<m; i++)
 -    for (unsigned int j=0; j<n; j++)
 +  for (size_type i=0; i<m; i++)
 +    for (size_type j=0; j<n; j++)
        {
          number2 add_value = adding ? dst(i,j) : 0.;
 -        for (unsigned int k=0; k<l; k++)
 +        for (size_type k=0; k<l; k++)
            add_value += (number2)(*this)(k,i) * (number2)(src(j,k));
          dst(i,j) = add_value;
        }
index 63552c1fde7a432de898f4cc001bb3c6e3d3a170,b7a791dd2bc4b75e8fd2249d35f5f5f5c676571a..acb37139a510fb933507b7d29c707b641b5b3327
@@@ -366,8 -352,15 +366,15 @@@ namespace interna
         * contiguous memory region and store the rowstart in the variable @p
         * row_starts_plain_indices.
         */
 -      std::vector<unsigned int> plain_dof_indices;
 +      std::vector<types::global_dof_index> plain_dof_indices;
  
+       /**
+        * Stores the dimension of the underlying DoFHandler. Since the indices
+        * are not templated, this is the variable that makes the dimension
+        * accessible in the (rare) cases it is needed inside this class.
+        */
+       unsigned int dimension;
        /**
         * Stores the number of components in the DoFHandler where the indices
         * have been read from.
index 062dd166dc92ae7cb708b65c7c87fca0347ef22e,187716af64e9a9e3fb2ab7bac8f7453071014419..6365734a49c053e237cbdbc44637010f3eca1866
@@@ -2453,8 -2439,12 +2439,12 @@@ FEEvaluationBase<dim,dofs_per_cell_,n_q
    // loop over all local dofs. ind_local holds local number on cell, index
    // iterates over the elements of index_local_to_global and dof_indices
    // points to the global indices stored in index_local_to_global
 -  const unsigned int *dof_indices = dof_info.begin_indices_plain(cell);
 +  const types::global_dof_index *dof_indices = dof_info.begin_indices_plain(cell);
  
+   const unsigned int n_irreg_components_filled =
+     std_cxx1x::get<2>(dof_info.row_starts[cell]);
+   const bool at_irregular_cell = n_irreg_components_filled > 0;
    // scalar case (or case when all components have the same degrees of freedom
    // and sit on a different vector each)
    if (n_fe_components == 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.