]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix at least one issue with my commit: The flux sparsity pattern needs to include...
authorkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 18 Jan 2014 22:41:19 +0000 (22:41 +0000)
committerkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 18 Jan 2014 22:41:19 +0000 (22:41 +0000)
git-svn-id: https://svn.dealii.org/trunk@32251 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/lac/trilinos_sparse_matrix.h
deal.II/source/dofs/dof_tools_sparsity.cc

index 13571aa507be8574654040be2750c7b474c00ab1..92d4d816f816e98d10a856e6ef0a57f2c48878da 100644 (file)
@@ -2756,10 +2756,18 @@ namespace TrilinosWrappers
           std::cout << col_index_ptr[i] << " ";
         std::cout << std::endl << std::endl;
         std::cout << "Matrix row has the following indices:" << std::endl;
-        int n_indices, *indices;
-        trilinos_sparsity_pattern().ExtractMyRowView(row_partitioner().LID(static_cast<TrilinosWrappers::types::int_type>(row)),
-                                                     n_indices,
-                                                     indices);
+        std::vector<TrilinosWrappers::types::int_type> indices;
+        const Epetra_CrsGraph* graph =
+          (nonlocal_matrix.get() != 0 &&
+           row_partitioner().MyGID(static_cast<TrilinosWrappers::types::int_type>(row)) == false) ?
+          &nonlocal_matrix->Graph() : &matrix->Graph();
+
+        indices.resize(graph->NumGlobalIndices(static_cast<TrilinosWrappers::types::int_type>(row)));
+        int n_indices = 0;
+        graph->ExtractGlobalRowCopy(static_cast<TrilinosWrappers::types::int_type>(row),
+                                    indices.size(), n_indices, &indices[0]);
+        AssertDimension(static_cast<unsigned int>(n_indices), indices.size());
+
         for (TrilinosWrappers::types::int_type i=0; i<n_indices; ++i)
           std::cout << indices[i] << " ";
         std::cout << std::endl << std::endl;
index c48bf2f677d5a5d0babcb22a7edd15032867e9bd..917e6d000ada5fb14eeb98bcf90bdec4657cc6f6 100644 (file)
@@ -615,9 +615,15 @@ namespace DoFTools
                           ||
                           (cell->neighbor(face)->subdomain_id() !=
                            cell->subdomain_id()))
-                        constraints.add_entries_local_to_global
-                        (dofs_on_other_cell, dofs_on_this_cell,
-                         sparsity, keep_constrained_dofs);
+                        {
+                          constraints.add_entries_local_to_global
+                            (dofs_on_other_cell, dofs_on_this_cell,
+                             sparsity, keep_constrained_dofs);
+                          if (cell->neighbor(face)->active())
+                            constraints.add_entries_local_to_global
+                              (dofs_on_other_cell, dofs_on_other_cell,
+                               sparsity, keep_constrained_dofs);
+                        }
                     }
                 }
             }

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.