]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
add initialization of local blocks
authorkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 12 Mar 2012 22:56:34 +0000 (22:56 +0000)
committerkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 12 Mar 2012 22:56:34 +0000 (22:56 +0000)
git-svn-id: https://svn.dealii.org/trunk@25265 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/meshworker/simple.h

index 6e4078053498b89080c5c72cc355983c6b69a3d1..a7b3c6ef859775fff5b35314ec018ab0d52d5881 100644 (file)
@@ -165,7 +165,7 @@ namespace MeshWorker
                                          * initialize_info() will
                                          * generate one local matrix
                                          * for each block row and
-                                         * column, whch will be
+                                         * column, which will be
                                          * numbered
                                          * lexicographically, row by
                                          * row.
@@ -650,7 +650,26 @@ namespace MeshWorker
     inline void
     MatrixSimple<MATRIX>::initialize_info(DOFINFO& info, bool face) const
     {
-      info.initialize_matrices(1, face);
+      const unsigned int n = local_indices.size();
+      
+      if (n == 0)
+       info.initialize_matrices(1, face);
+      else
+       {
+         info.initialize_matrices(n*n, face);
+         unsigned int k=0;
+         for (unsigned int i=0;i<n;++i)
+           for (unsigned int j=0;j<n;++j,++k)
+             {
+               info.matrix(k,false).row = i;
+               info.matrix(k,false).column = j;
+               if (face)
+                 {
+                   info.matrix(k,true).row = i;
+                   info.matrix(k,true).column = j;
+                 }
+             }
+       }
     }
 
 

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.