16 #ifndef dealii__trilinos_vector_h 17 #define dealii__trilinos_vector_h 20 #include <deal.II/base/config.h> 22 #ifdef DEAL_II_WITH_TRILINOS 24 # include <deal.II/base/std_cxx11/shared_ptr.h> 25 # include <deal.II/base/subscriptor.h> 26 # include <deal.II/base/index_set.h> 27 # include <deal.II/base/utilities.h> 28 # include <deal.II/lac/exceptions.h> 29 # include <deal.II/lac/vector.h> 30 # include <deal.II/lac/trilinos_vector_base.h> 31 # include <deal.II/lac/vector_type_traits.h> 33 DEAL_II_DISABLE_EXTRA_DIAGNOSTICS
34 # include "Epetra_Map.h" 35 # include "Epetra_LocalMap.h" 36 DEAL_II_ENABLE_EXTRA_DIAGNOSTICS
38 DEAL_II_NAMESPACE_OPEN
42 template <
typename>
class Vector;
54 #ifndef DEAL_II_WITH_64BIT_INDICES 59 int gid(
const Epetra_BlockMap &map,
int i)
68 long long int gid(
const Epetra_BlockMap &map,
int i)
293 #ifdef DEAL_II_WITH_CXX11 333 const bool omit_zeroing_entries =
false,
334 const bool allow_different_maps =
false);
340 const bool import_data =
false);
357 #ifdef DEAL_II_WITH_CXX11 385 template <
typename Number>
406 (const ::TrilinosWrappers::SparseMatrix &matrix,
429 explicit Vector (
const Epetra_Map ¶llel_partitioning) DEAL_II_DEPRECATED;
447 Vector (
const Epetra_Map ¶llel_partitioning,
464 template <
typename number>
465 void reinit (
const Epetra_Map ¶llel_partitioner,
466 const ::Vector<number> &v) DEAL_II_DEPRECATED;
482 void reinit (
const Epetra_Map ¶llel_partitioning,
483 const bool omit_zeroing_entries =
false) DEAL_II_DEPRECATED;
499 template <typename Number>
500 Vector (const Epetra_Map ¶llel_partitioning,
501 const ::
Vector<Number> &v) DEAL_II_DEPRECATED;
526 const MPI_Comm &communicator = MPI_COMM_WORLD);
541 const MPI_Comm &communicator = MPI_COMM_WORLD);
559 const MPI_Comm &communicator = MPI_COMM_WORLD);
573 template <typename Number>
575 const ::
Vector<Number> &v,
576 const MPI_Comm &communicator = MPI_COMM_WORLD);
602 const MPI_Comm &communicator = MPI_COMM_WORLD,
603 const
bool omit_zeroing_entries = false);
632 const MPI_Comm &communicator = MPI_COMM_WORLD,
633 const
bool vector_writable = false);
660 template <
typename number>
662 const ::Vector<number> &v)
669 template <
typename number>
671 const ::Vector<number> &v,
672 const MPI_Comm &communicator)
682 template <
typename number>
684 const ::Vector<number> &v)
686 if (
vector.get() == 0 ||
vector->Map().SameAs(parallel_partitioner) ==
false)
687 reinit(parallel_partitioner);
689 const int size = parallel_partitioner.NumMyElements();
693 for (
int i=0; i<
size; ++i)
694 (*
vector)[0][i] = v(gid(parallel_partitioner,i));
709 template <
typename Number>
713 if (
size() != v.size())
715 vector.reset (
new Epetra_FEVector(Epetra_Map
716 (static_cast<TrilinosWrappers::types::int_type>(v.size()), 0,
717 #ifdef DEAL_II_WITH_MPI
718 Epetra_MpiComm(MPI_COMM_SELF)
726 const int size = map.NumMyElements();
730 for (
int i=0; i<
size; ++i)
731 (*
vector)[0][i] = v(gid(map,i));
784 Vector () DEAL_II_DEPRECATED;
800 explicit
Vector (const Epetra_Map &partitioning) DEAL_II_DEPRECATED;
812 const MPI_Comm &communicator = MPI_COMM_WORLD) DEAL_II_DEPRECATED;
824 template <typename Number>
825 explicit
Vector (const ::
Vector<Number> &v) DEAL_II_DEPRECATED;
837 const
bool omit_zeroing_entries = false);
856 void reinit (const Epetra_Map &input_map,
857 const
bool omit_zeroing_entries = false);
877 const MPI_Comm &communicator = MPI_COMM_WORLD,
878 const
bool omit_zeroing_entries = false);
894 const
bool omit_zeroing_entries = false,
895 const
bool allow_different_maps = false);
903 Vector &operator= (const TrilinosScalar s);
914 template <typename Number>
934 void update_ghost_values () const;
958 template <
typename number>
962 vector.reset (
new Epetra_FEVector(map));
979 template <
typename Number>
983 if (
size() != v.size())
987 Epetra_LocalMap map ((TrilinosWrappers::types::int_type)v.size(), 0,
989 vector.reset (
new Epetra_FEVector(map));
994 const TrilinosWrappers::types::int_type
size = map.NumMyElements();
1002 for (TrilinosWrappers::types::int_type i=0; i<
size; ++i)
1027 template <
typename>
class ReinitHelper;
1037 template <
typename Matrix>
1039 void reinit_range_vector (
const Matrix &matrix,
1041 bool omit_zeroing_entries)
1043 v.
reinit(matrix.locally_owned_range_indices(), matrix.get_mpi_communicator(), omit_zeroing_entries);
1046 template <
typename Matrix>
1048 void reinit_domain_vector(
const Matrix &matrix,
1050 bool omit_zeroing_entries)
1052 v.
reinit(matrix.locally_owned_domain_indices(), matrix.get_mpi_communicator(), omit_zeroing_entries);
1064 template <
typename Matrix>
1066 void reinit_range_vector (
const Matrix &matrix,
1068 bool omit_zeroing_entries)
1070 v.
reinit(matrix.locally_owned_range_indices(),
1071 matrix.get_mpi_communicator(),
1072 omit_zeroing_entries);
1075 template <
typename Matrix>
1077 void reinit_domain_vector(
const Matrix &matrix,
1079 bool omit_zeroing_entries)
1081 v.
reinit(matrix.locally_owned_domain_indices(),
1082 matrix.get_mpi_communicator(),
1083 omit_zeroing_entries);
1113 DEAL_II_NAMESPACE_CLOSE
1115 #endif // DEAL_II_WITH_TRILINOS Vector & operator=(const TrilinosScalar s)
::types::global_dof_index size_type
const Epetra_Comm & comm_self()
void reinit(const VectorBase &v, const bool omit_zeroing_entries=false, const bool allow_different_maps=false)
Epetra_Map make_trilinos_map(const MPI_Comm &communicator=MPI_COMM_WORLD, const bool overlapping=false) const
std_cxx11::shared_ptr< Epetra_FEVector > vector
#define Assert(cond, exc)
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
const Epetra_Map & vector_partitioner() const
void update_ghost_values() const
void swap(Vector &u, Vector &v)
void import_nonlocal_data_for_fe(const ::TrilinosWrappers::SparseMatrix &matrix, const Vector &vector)
VectorBase & operator=(const TrilinosScalar s)
void reinit(const size_type n, const bool omit_zeroing_entries=false)
::types::global_dof_index size_type
static const bool supports_distributed_data