From: denis.davydov Date: Wed, 5 Mar 2014 15:38:09 +0000 (+0000) Subject: fixed numerous bugs related to constraint_matrix. Limited instantiation of distribute... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f76d4d843dee74847893fdac52faaeac99c26747;p=dealii-svn.git fixed numerous bugs related to constraint_matrix. Limited instantiation of distribute_local_to_global to appropriate pairs of vectors git-svn-id: https://svn.dealii.org/branches/branch_petscscalar_complex@32617 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/lac/constraint_matrix.h b/deal.II/include/deal.II/lac/constraint_matrix.h index c579960de7..3bc685c490 100644 --- a/deal.II/include/deal.II/lac/constraint_matrix.h +++ b/deal.II/include/deal.II/lac/constraint_matrix.h @@ -814,7 +814,7 @@ public: */ template void - distribute_local_to_global (const Vector &local_vector, + distribute_local_to_global (const Vector &local_vector, const std::vector &local_dof_indices, VectorType &global_vector, const FullMatrix &local_matrix) const; @@ -1752,7 +1752,7 @@ distribute_local_to_global (const FullMatrix > &local_matri { // create a dummy and hand on to the function actually implementing this // feature in the cm.templates.h file. - Vector dummy(0); + Vector > dummy(0); distribute_local_to_global (local_matrix, dummy, local_dof_indices, global_matrix, dummy, false, dealii::internal::bool2type::value>()); diff --git a/deal.II/include/deal.II/lac/constraint_matrix.templates.h b/deal.II/include/deal.II/lac/constraint_matrix.templates.h index 170058d026..704dd27981 100644 --- a/deal.II/include/deal.II/lac/constraint_matrix.templates.h +++ b/deal.II/include/deal.II/lac/constraint_matrix.templates.h @@ -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 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 + template inline void set_matrix_diagonals (const internals::GlobalRowsFromLocal &global_rows, const std::vector &local_dof_indices, @@ -2435,8 +2436,9 @@ make_sorted_row_list (const std::vector &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 +template void ConstraintMatrix::distribute_local_to_global ( const FullMatrix &local_matrix, @@ -2586,7 +2588,7 @@ ConstraintMatrix::distribute_local_to_global ( -template +template void ConstraintMatrix::distribute_local_to_global ( const FullMatrix &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 +template void ConstraintMatrix:: distribute_local_to_global (const FullMatrix &local_matrix, diff --git a/deal.II/source/lac/constraint_matrix.cc b/deal.II/source/lac/constraint_matrix.cc index 1a59875b6a..9da8ec2288 100644 --- a/deal.II/source/lac/constraint_matrix.cc +++ b/deal.II/source/lac/constraint_matrix.cc @@ -1761,11 +1761,14 @@ ConstraintMatrix::resolve_indices (std::vector &indices const FullMatrix &) 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 diff --git a/deal.II/source/lac/constraint_matrix.inst.in b/deal.II/source/lac/constraint_matrix.inst.in index be0efea90d..418584da96 100644 --- a/deal.II/source/lac/constraint_matrix.inst.in +++ b/deal.II/source/lac/constraint_matrix.inst.in @@ -43,12 +43,12 @@ for (V: EXTERNAL_SEQUENTIAL_VECTORS) template void ConstraintMatrix::distribute(const V&, V&) const; template void ConstraintMatrix::set_zero(V&) const; } - -for (V: EXTERNAL_SEQUENTIAL_VECTORS) - { + +for (V: REAL_EXTERNAL_SEQUENTIAL_VECTORS) + { template void ConstraintMatrix::distribute_local_to_global ( const Vector&, const std::vector &, V&, const FullMatrix&) const; - } + } for (V: COMPLEX_EXTERNAL_SEQUENTIAL_VECTORS) {