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#ifdef DEAL_II_WITH_TRILINOS
94 vector[0][trilinos_i] +=
value;
111 vector[0][trilinos_i] =
value;
125 return vector[0][trilinos_i];
130# ifdef DEAL_II_TRILINOS_WITH_TPETRA
131 template <
typename NumberType>
152 template <
typename NumberType>
160 Tpetra::Vector<NumberType, int, types::signed_global_dof_index> vector =
163 vector.getMap()->getLocalElement(
166# if DEAL_II_TRILINOS_VERSION_GTE(13, 2, 0)
167 auto vector_2d = vector.template getLocalView<Kokkos::HostSpace>(
168 Tpetra::Access::ReadWrite);
170 vector.template sync<Kokkos::HostSpace>();
171 auto vector_2d = vector.template getLocalView<Kokkos::HostSpace>();
173 auto vector_1d = Kokkos::subview(vector_2d, Kokkos::ALL(), 0);
174# if !DEAL_II_TRILINOS_VERSION_GTE(13, 2, 0)
176 vector.template modify<Kokkos::HostSpace>();
178 vector_1d(trilinos_i) +=
value;
179# if !DEAL_II_TRILINOS_VERSION_GTE(13, 2, 0)
180 vector.template sync<
181 typename Tpetra::Vector<NumberType, int, types::signed_global_dof_index>::
182 device_type::memory_space>();
188 template <
typename NumberType>
196 Tpetra::Vector<NumberType, int, types::signed_global_dof_index> vector =
199 vector.getMap()->getLocalElement(
202# if DEAL_II_TRILINOS_VERSION_GTE(13, 2, 0)
203 auto vector_2d = vector.template getLocalView<Kokkos::HostSpace>(
204 Tpetra::Access::ReadWrite);
206 vector.template sync<Kokkos::HostSpace>();
207 auto vector_2d = vector.template getLocalView<Kokkos::HostSpace>();
209 auto vector_1d = Kokkos::subview(vector_2d, Kokkos::ALL(), 0);
211# if !DEAL_II_TRILINOS_VERSION_GTE(13, 2, 0)
212 vector.template modify<Kokkos::HostSpace>();
214 vector_1d(trilinos_i) =
value;
215# if !DEAL_II_TRILINOS_VERSION_GTE(13, 2, 0)
216 vector.template sync<
217 typename Tpetra::Vector<NumberType, int, types::signed_global_dof_index>::
218 device_type::memory_space>();
224 template <
typename NumberType>
231 Tpetra::Vector<NumberType, int, types::signed_global_dof_index> vector =
234 vector.getMap()->getLocalElement(
237# if DEAL_II_TRILINOS_VERSION_GTE(13, 2, 0)
239 vector.template getLocalView<Kokkos::HostSpace>(Tpetra::Access::ReadOnly);
241 vector.template sync<Kokkos::HostSpace>();
242 auto vector_2d = vector.template getLocalView<Kokkos::HostSpace>();
244 auto vector_1d = Kokkos::subview(vector_2d, Kokkos::ALL(), 0);
245 return vector_1d(trilinos_i);
const Epetra_FEVector & trilinos_vector() const
const Tpetra::Vector< Number, int, types::signed_global_dof_index > & trilinos_vector() const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static VectorType::value_type get(const VectorType &V, const types::global_dof_index i)
static void set(typename VectorType::value_type value, const types::global_dof_index i, VectorType &V)
static void add(const typename VectorType::value_type value, const types::global_dof_index i, VectorType &V)