]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
fixed numerous bugs related to constraint_matrix. Limited instantiation of distribute...
authordenis.davydov <denis.davydov@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 5 Mar 2014 15:38:09 +0000 (15:38 +0000)
committerdenis.davydov <denis.davydov@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 5 Mar 2014 15:38:09 +0000 (15:38 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_petscscalar_complex@32617 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/lac/constraint_matrix.h
deal.II/include/deal.II/lac/constraint_matrix.templates.h
deal.II/source/lac/constraint_matrix.cc
deal.II/source/lac/constraint_matrix.inst.in

index c579960de774bd25ab3e68b9f60649b9d6e63265..3bc685c49090c61c58e8649fd1991c03956e4e22 100644 (file)
@@ -814,7 +814,7 @@ public:
    */
   template <typename VectorType, typename LocalType>
   void
-  distribute_local_to_global (const Vector<double>         &local_vector,
+  distribute_local_to_global (const Vector<LocalType>      &local_vector,
                               const std::vector<size_type> &local_dof_indices,
                               VectorType                   &global_vector,
                               const FullMatrix<LocalType>  &local_matrix) const;
@@ -1752,7 +1752,7 @@ distribute_local_to_global (const FullMatrix<std::complex<double> > &local_matri
 {
   // create a dummy and hand on to the function actually implementing this
   // feature in the cm.templates.h file.
-  Vector<double> dummy(0);
+  Vector<std::complex<double> > dummy(0);
   distribute_local_to_global (local_matrix, dummy, local_dof_indices,
                               global_matrix, dummy, false,
                               dealii::internal::bool2type<IsBlockMatrix<MatrixType>::value>());
index 170058d0261a7a24cff6b8ccac5259a19d467662..704dd279819041c6c2a1ca36a3029092001780dc 100644 (file)
@@ -1851,8 +1851,9 @@ namespace internals
   // resolves constraints of one column at the innermost loop. goes through
   // the origin of each global entry and finds out which data we need to
   // collect.
+  template<typename LocalType>
   static inline
-  double resolve_matrix_entry (const GlobalRowsFromLocal   &global_rows,
+  LocalType resolve_matrix_entry (const GlobalRowsFromLocal   &global_rows,
                                const GlobalRowsFromLocal   &global_cols,
                                const size_type             i,
                                const size_type             j,
@@ -2228,7 +2229,7 @@ add_this_index:
   // degrees of freedom to which this dof is constrained are also constrained
   // (the usual case with hanging nodes in 3d). however, in the line below, we
   // do actually do something with this dof
-  template <typename MatrixType, typename VectorType>
+  template <typename MatrixType, typename VectorType, typename LocalType>
   inline void
   set_matrix_diagonals (const internals::GlobalRowsFromLocal &global_rows,
                         const std::vector<size_type>         &local_dof_indices,
@@ -2435,8 +2436,9 @@ make_sorted_row_list (const std::vector<size_type> &local_dof_indices,
 
 
 // Resolve the constraints from the vector and apply inhomogeneities.
+template< typename LocalType>
 inline
-double
+LocalType
 ConstraintMatrix::
 resolve_vector_entry (const size_type                       i,
                       const internals::GlobalRowsFromLocal &global_rows,
@@ -2479,7 +2481,7 @@ resolve_vector_entry (const size_type                       i,
 
 // internal implementation for distribute_local_to_global for standard
 // (non-block) matrices
-template <typename MatrixType, typename VectorType>
+template <typename MatrixType, typename VectorType, typename LocalType>
 void
 ConstraintMatrix::distribute_local_to_global (
   const FullMatrix<LocalType>     &local_matrix,
@@ -2586,7 +2588,7 @@ ConstraintMatrix::distribute_local_to_global (
 
 
 
-template <typename MatrixType>
+template <typename MatrixType, typename LocalType>
 void
 ConstraintMatrix::distribute_local_to_global (
   const FullMatrix<LocalType>  &local_matrix,
@@ -2646,7 +2648,7 @@ ConstraintMatrix::distribute_local_to_global (
 
 // similar function as above, but now specialized for block matrices. See the
 // other function for additional comments.
-template <typename MatrixType, typename VectorType>
+template <typename MatrixType, typename VectorType, typename LocalType>
 void
 ConstraintMatrix::
 distribute_local_to_global (const FullMatrix<LocalType>  &local_matrix,
index 1a59875b6a0951e1321f6a202ad0539b99e145cc..9da8ec2288b7f9c6c30351ce2cf34ef8e2b7961c 100644 (file)
@@ -1761,11 +1761,14 @@ ConstraintMatrix::resolve_indices (std::vector<types::global_dof_index> &indices
                                            const FullMatrix<double>        &) const
 
 #ifdef DEAL_II_WITH_PETSC
+#ifndef PETSC_USE_COMPLEX
 VECTOR_FUNCTIONS(PETScWrappers::MPI::Vector);
 VECTOR_FUNCTIONS(PETScWrappers::MPI::BlockVector);
+#else
 // if PETSC_COMPLEX @whattodo check this works
-VECTOR_FUNCTIONS_COMPLEX(PETScWrappers::MPI::Vector);
-VECTOR_FUNCTIONS_COMPLEX(PETScWrappers::MPI::BlockVector);
+COMPLEX_VECTOR_FUNCTIONS(PETScWrappers::MPI::Vector);
+COMPLEX_VECTOR_FUNCTIONS(PETScWrappers::MPI::BlockVector);
+#endif
 #endif
 
 #ifdef DEAL_II_WITH_TRILINOS
index be0efea90ddc8dfe7b391b195ff34bab5d038bc8..418584da960b324ea1534d6b568ba5e0303a82d3 100644 (file)
@@ -43,12 +43,12 @@ for (V: EXTERNAL_SEQUENTIAL_VECTORS)
     template void ConstraintMatrix::distribute<V >(const V&, V&) const;
     template void ConstraintMatrix::set_zero<V >(V&) const;
   }
-
-for (V: EXTERNAL_SEQUENTIAL_VECTORS)
-  {   
+  
+for (V: REAL_EXTERNAL_SEQUENTIAL_VECTORS)
+  {
     template void ConstraintMatrix::distribute_local_to_global<V > (
       const Vector<double>&, const std::vector<types::global_dof_index> &, V&, const FullMatrix<double>&) const;
-  }
+  } 
 
 for (V: COMPLEX_EXTERNAL_SEQUENTIAL_VECTORS)
   {   

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.