]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
add BlockIndices to MatrixBlock
authorkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 20 Mar 2010 16:59:23 +0000 (16:59 +0000)
committerkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 20 Mar 2010 16:59:23 +0000 (16:59 +0000)
git-svn-id: https://svn.dealii.org/trunk@20868 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/numerics/mesh_worker_assembler.h
deal.II/lac/include/lac/matrix_block.h

index 015bfca1e90cf55ede17fc4d9778ace7c33da9ba..6dc6900ecbcd0a22a51bf2ecf73e26d7f5b43559 100644 (file)
@@ -1444,19 +1444,8 @@ namespace MeshWorker
                                               // our local matrices
              const unsigned int jcell = this->block_info->local().local_to_global(block_row, j);
              const unsigned int kcell = this->block_info->local().local_to_global(block_col, k);
-
-                                              // The global dof
-                                              // indices to assemble
-                                              // in. Since we may
-                                              // have face matrices
-                                              // coupling two
-                                              // different cells, we
-                                              // provide two sets of
-                                              // dof indices.
-             const unsigned int jglobal = this->block_info->global().global_to_local(dof1[jcell]).second;
-             const unsigned int kglobal = this->block_info->global().global_to_local(dof2[kcell]).second;
              
-             global.add(jglobal, kglobal, local(j,k));
+             global.add(dof1[jcell], dof2[kcell], local(j,k));
            }
     }
 
index 03b9a64260cafd70ea38c07ec608a04afec774b8..379705e8d7a56cffe144a6165203fe55cd8416de 100644 (file)
@@ -320,6 +320,8 @@ MatrixBlock<MATRIX>::add (const std::vector<unsigned int>&         row_indices,
                                  const FullMatrix<number>&        values,
                                  const bool                       elide_zero_values)
 {
+  Assert(block_indices != 0, ExcNotInitialized());
+  
   AssertDimension (row_indices.size(), values.m());
   AssertDimension (col_indices.size(), values.n());
   
@@ -338,6 +340,8 @@ MatrixBlock<MATRIX>::add (const std::vector<unsigned int> &indices,
                          const FullMatrix<number>        &values,
                          const bool                       elide_zero_values)
 {
+  Assert(block_indices != 0, ExcNotInitialized());
+  
   AssertDimension (indices.size(), values.m());
   Assert (values.n() == values.m(), ExcNotQuadratic());
   
@@ -356,7 +360,8 @@ MatrixBlock<MATRIX>::add (const unsigned int               row,
                          const std::vector<unsigned int> &col_indices,
                          const std::vector<number>       &values,
                          const bool                       elide_zero_values)
-{
+{ 
+  Assert(block_indices != 0, ExcNotInitialized());
   AssertDimension (col_indices.size(), values.size());
   add (row, col_indices.size(), &col_indices[0], &values[0],
        elide_zero_values);
@@ -374,6 +379,7 @@ MatrixBlock<MATRIX>::add (const unsigned int   b_row,
                          const bool,
                          const bool)
 {
+  Assert(block_indices != 0, ExcNotInitialized());
   const std::pair<unsigned int, unsigned int> bi
     = block_indices->global_to_local(b_row);
 

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.