16 #ifndef dealii_read_write_vector_h
17 #define dealii_read_write_vector_h
34 #ifdef DEAL_II_WITH_TRILINOS
39 # include <Epetra_MultiVector.h>
49 class CommunicationPatternBase;
52 template <
typename,
typename>
57 # ifdef DEAL_II_WITH_PETSC
67 # ifdef DEAL_II_WITH_TRILINOS
77 # ifdef DEAL_II_WITH_CUDA
130 template <
typename Number>
199 template <
typename Number2>
202 const bool omit_zeroing_entries =
false);
215 const bool omit_zeroing_entries =
false);
218 #ifdef DEAL_II_WITH_TRILINOS
219 # ifdef DEAL_II_WITH_MPI
249 template <
typename Functor>
251 apply(
const Functor &func);
277 template <
typename Number2>
296 template <
typename MemorySpace>
300 const std::shared_ptr<const CommunicationPatternBase>
301 &communication_pattern =
302 std::shared_ptr<const CommunicationPatternBase>());
304 #ifdef DEAL_II_WITH_PETSC
316 const std::shared_ptr<const CommunicationPatternBase>
317 &communication_pattern =
318 std::shared_ptr<const CommunicationPatternBase>());
321 #ifdef DEAL_II_WITH_TRILINOS
335 const std::shared_ptr<const CommunicationPatternBase>
336 &communication_pattern =
337 std::shared_ptr<const CommunicationPatternBase>());
339 # ifdef DEAL_II_WITH_MPI
340 # ifdef DEAL_II_TRILINOS_WITH_TPETRA
352 const std::shared_ptr<const CommunicationPatternBase>
353 &communication_pattern =
354 std::shared_ptr<const CommunicationPatternBase>());
368 const std::shared_ptr<const CommunicationPatternBase>
369 &communication_pattern =
370 std::shared_ptr<const CommunicationPatternBase>());
374 #ifdef DEAL_II_WITH_CUDA
384 const std::shared_ptr<const CommunicationPatternBase>
385 &communication_pattern =
386 std::shared_ptr<const CommunicationPatternBase>());
499 template <
typename Number2>
502 std::vector<Number2> &
values)
const;
531 template <
typename ForwardIterator,
typename OutputIterator>
534 const ForwardIterator indices_end,
535 OutputIterator values_begin)
const;
574 template <
typename Number2>
576 add(
const std::vector<size_type> &indices,
577 const std::vector<Number2> &
values);
583 template <
typename Number2>
585 add(
const std::vector<size_type> & indices,
593 template <
typename Number2>
603 print(std::ostream & out,
604 const unsigned int precision = 3,
605 const bool scientific =
true)
const;
615 #ifdef DEAL_II_WITH_TRILINOS
616 # ifdef DEAL_II_TRILINOS_WITH_TPETRA
624 const Tpetra::Vector<Number, int, types::global_dof_index> &tpetra_vector,
625 const IndexSet & locally_owned_elements,
628 const std::shared_ptr<const CommunicationPatternBase>
629 &communication_pattern);
638 import(
const Epetra_MultiVector &multivector,
639 const IndexSet & locally_owned_elements,
642 const std::shared_ptr<const CommunicationPatternBase>
643 &communication_pattern);
654 return static_cast<unsigned int>(
664 #if defined(DEAL_II_WITH_TRILINOS) && defined(DEAL_II_WITH_MPI)
665 # ifdef DEAL_II_TRILINOS_WITH_TPETRA
709 mutable std::shared_ptr<::parallel::internal::TBBPartitioner>
713 template <
typename Number2>
722 template <
typename Functor>
757 template <
typename Number>
760 , values(nullptr,
free)
770 template <
typename Number>
772 const ReadWriteVector<Number> &v)
781 template <
typename Number>
794 template <
typename Number>
796 const IndexSet &locally_stored_indices)
808 template <
typename Number>
817 template <
typename Number>
826 template <
typename Number>
835 template <
typename Number>
844 template <
typename Number>
853 template <
typename Number>
862 template <
typename Number>
871 template <
typename Number>
880 template <
typename Number>
889 template <
typename Number>
898 template <
typename Number>
907 template <
typename Number>
908 template <
typename Number2>
911 const std::vector<size_type> &indices,
912 std::vector<Number2> & extracted_values)
const
914 for (
size_type i = 0; i < indices.size(); ++i)
915 extracted_values[i] =
operator()(indices[i]);
920 template <
typename Number>
921 template <
typename ForwardIterator,
typename OutputIterator>
924 ForwardIterator indices_begin,
925 const ForwardIterator indices_end,
926 OutputIterator values_begin)
const
928 while (indices_begin != indices_end)
938 template <
typename Number>
944 return values[local_index];
949 template <
typename Number>
955 return values[local_index];
960 template <
typename Number>
961 template <
typename Number2>
964 const std::vector<Number2> &
values)
967 add(indices.size(), indices.data(),
values.data());
972 template <
typename Number>
973 template <
typename Number2>
976 const ReadWriteVector<Number2> &
values)
984 "The given value is not finite but either infinite or Not A Number (NaN)"));
991 template <
typename Number>
992 template <
typename Number2>
996 const Number2 * values_to_add)
998 for (
size_type i = 0; i < n_indices; ++i)
1003 "The given value is not finite but either infinite or Not A Number (NaN)"));
1004 this->
operator()(indices[i]) += values_to_add[i];
1010 template <
typename Number>
1011 template <
typename Functor>
1013 ReadWriteVector<Number> &parent,
1014 const Functor & functor)
1021 template <
typename Number>
1022 template <
typename Functor>
1028 functor(parent.values[i]);
1031 #endif // ifndef DOXYGEN
1044 template <
typename Number>