]> https://gitweb.dealii.org/ - dealii.git/commitdiff
changed the make_fluy_sparsity_pattern in way that it can handle a
authorBaerbel Jannsen <baerbel.janssen@gmail.com>
Wed, 25 Aug 2010 14:59:34 +0000 (14:59 +0000)
committerBaerbel Jannsen <baerbel.janssen@gmail.com>
Wed, 25 Aug 2010 14:59:34 +0000 (14:59 +0000)
ConstraintMatrix

git-svn-id: https://svn.dealii.org/trunk@21707 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/dofs/dof_tools.cc

index a41638dba0b2eab198ff70861e4bc8bbb4ecb293..9d280a460ed68e753b3ff3e114555878ca439a18 100644 (file)
@@ -537,9 +537,9 @@ DoFTools::make_flux_sparsity_pattern (const DH        &dof,
                                // current cell is owned by the calling
                                // processor. Otherwise, just continue.
   for (; cell!=endc; ++cell)
-    //    if ((subdomain_id == numbers::invalid_unsigned_int)
-    //        ||
-    //        (subdomain_id == cell->subdomain_id()))
+    if ((subdomain_id == numbers::invalid_unsigned_int)
+        ||
+        (subdomain_id == cell->subdomain_id()))
     {
       const unsigned int n_dofs_on_this_cell = cell->get_fe().dofs_per_cell;
       dofs_on_this_cell.resize (n_dofs_on_this_cell);
@@ -589,14 +589,22 @@ DoFTools::make_flux_sparsity_pattern (const DH        &dof,
                      dofs_on_other_cell.resize (n_dofs_on_neighbor);
                      sub_neighbor->get_dof_indices (dofs_on_other_cell);
 
-                     for (unsigned int i=0; i<n_dofs_on_this_cell; ++i)
-                       sparsity.add_entries (dofs_on_this_cell[i],
-                                             dofs_on_other_cell.begin(),
-                                             dofs_on_other_cell.end());
-                     for (unsigned int j=0; j<n_dofs_on_neighbor; ++j)
-                       sparsity.add_entries (dofs_on_other_cell[j],
-                                             dofs_on_this_cell.begin(),
-                                             dofs_on_this_cell.end());
+      constraints.add_entries_local_to_global (dofs_on_this_cell,
+                                               dofs_on_other_cell,
+                                              sparsity,
+                                              keep_constrained_dofs);
+      constraints.add_entries_local_to_global (dofs_on_other_cell,
+                                               dofs_on_this_cell,
+                                              sparsity,
+                                              keep_constrained_dofs);
+//                   for (unsigned int i=0; i<n_dofs_on_this_cell; ++i)
+//                     sparsity.add_entries (dofs_on_this_cell[i],
+//                                           dofs_on_other_cell.begin(),
+//                                           dofs_on_other_cell.end());
+//                   for (unsigned int j=0; j<n_dofs_on_neighbor; ++j)
+//                     sparsity.add_entries (dofs_on_other_cell[j],
+//                                           dofs_on_this_cell.begin(),
+//                                           dofs_on_this_cell.end());
                      sub_neighbor->face(neighbor_face)->set_user_flag ();
                    }
                }
@@ -613,14 +621,22 @@ DoFTools::make_flux_sparsity_pattern (const DH        &dof,
 
                  neighbor->get_dof_indices (dofs_on_other_cell);
 
-                 for (unsigned int i=0; i<n_dofs_on_this_cell; ++i)
-                   sparsity.add_entries (dofs_on_this_cell[i],
-                                         dofs_on_other_cell.begin(),
-                                         dofs_on_other_cell.end());
-                 for (unsigned int j=0; j<n_dofs_on_neighbor; ++j)
-                   sparsity.add_entries (dofs_on_other_cell[j],
-                                         dofs_on_this_cell.begin(),
-                                         dofs_on_this_cell.end());
+      constraints.add_entries_local_to_global (dofs_on_this_cell,
+                                               dofs_on_other_cell,
+                                              sparsity,
+                                              keep_constrained_dofs);
+      constraints.add_entries_local_to_global (dofs_on_other_cell,
+                                               dofs_on_this_cell,
+                                              sparsity,
+                                              keep_constrained_dofs);
+//               for (unsigned int i=0; i<n_dofs_on_this_cell; ++i)
+//                 sparsity.add_entries (dofs_on_this_cell[i],
+//                                       dofs_on_other_cell.begin(),
+//                                       dofs_on_other_cell.end());
+//               for (unsigned int j=0; j<n_dofs_on_neighbor; ++j)
+//                 sparsity.add_entries (dofs_on_other_cell[j],
+//                                       dofs_on_this_cell.begin(),
+//                                       dofs_on_this_cell.end());
                  neighbor->face(neighbor_face)->set_user_flag ();
                }
            }

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.