16 #ifndef dealii_vector_element_access_h 17 #define dealii_vector_element_access_h 29 template <
typename VectorType>
34 add(
const typename VectorType::value_type
value,
39 set(
typename VectorType::value_type
value,
43 static typename VectorType::value_type
49 template <
typename VectorType>
60 template <
typename VectorType>
71 template <
typename VectorType>
72 inline typename VectorType::value_type
81 #if defined(DEAL_II_WITH_TRILINOS) && defined(DEAL_II_WITH_MPI) 92 vector.Map().LID(static_cast<TrilinosWrappers::types::int_type>(i));
94 vector[0][trilinos_i] +=
value;
109 vector.Map().LID(static_cast<TrilinosWrappers::types::int_type>(i));
111 vector[0][trilinos_i] =
value;
123 vector.Map().LID(static_cast<TrilinosWrappers::types::int_type>(i));
125 return vector[0][trilinos_i];
130 # ifdef DEAL_II_TRILINOS_WITH_TPETRA 131 template <
typename NumberType>
137 add(
const typename VectorType::value_type
value,
142 set(
typename VectorType::value_type
value,
146 static typename VectorType::value_type
152 template <
typename NumberType>
155 const typename VectorType::value_type
value,
160 Tpetra::Vector<NumberType, int, types::global_dof_index> vector =
163 vector.getMap()->getLocalElement(
164 static_cast<TrilinosWrappers::types::int_type>(i));
166 vector.template sync<Kokkos::HostSpace>();
167 auto vector_2d = vector.template getLocalView<Kokkos::HostSpace>();
168 auto vector_1d = Kokkos::subview(vector_2d, Kokkos::ALL(), 0);
170 vector.template modify<Kokkos::HostSpace>();
171 vector_1d(trilinos_i) +=
value;
172 vector.template sync<
173 typename Tpetra::Vector<NumberType, int, types::global_dof_index>::
174 device_type::memory_space>();
179 template <
typename NumberType>
182 const typename VectorType::value_type
value,
187 Tpetra::Vector<NumberType, int, types::global_dof_index> vector =
190 vector.getMap()->getLocalElement(
191 static_cast<TrilinosWrappers::types::int_type>(i));
193 vector.template sync<Kokkos::HostSpace>();
194 auto vector_2d = vector.template getLocalView<Kokkos::HostSpace>();
195 auto vector_1d = Kokkos::subview(vector_2d, Kokkos::ALL(), 0);
197 vector.template modify<Kokkos::HostSpace>();
198 vector_1d(trilinos_i) =
value;
199 vector.template sync<
200 typename Tpetra::Vector<NumberType, int, types::global_dof_index>::
201 device_type::memory_space>();
206 template <
typename NumberType>
213 Tpetra::Vector<NumberType, int, types::global_dof_index> vector =
216 vector.getMap()->getLocalElement(
217 static_cast<TrilinosWrappers::types::int_type>(i));
219 vector.template sync<Kokkos::HostSpace>();
220 auto vector_2d = vector.template getLocalView<Kokkos::HostSpace>();
221 auto vector_1d = Kokkos::subview(vector_2d, Kokkos::ALL(), 0);
223 return vector_1d(trilinos_i);
static void set(typename VectorType::value_type value, const types::global_dof_index i, VectorType &V)
#define DEAL_II_NAMESPACE_CLOSE
const Epetra_FEVector & trilinos_vector() const
static VectorType::value_type get(const VectorType &V, const types::global_dof_index i)
const Tpetra::Vector< Number, int, types::global_dof_index > & trilinos_vector() const
#define DEAL_II_NAMESPACE_OPEN
static void add(const typename VectorType::value_type value, const types::global_dof_index i, VectorType &V)