libMesh
Loading...
Searching...
No Matches
Classes | Typedefs | Functions
libMesh::Kokkos::detail Namespace Reference

Classes

struct  divide_value
 
struct  negate_value
 Componentwise transform functors, shared by the vector helpers here and the tensor helpers in kokkos_tensor_ops.h. More...
 
struct  scale_value
 

Typedefs

template<typename T >
using remove_cvref_t = typename std::remove_cv< typename std::remove_reference< T >::type >::type
 Strips reference and const/volatile qualifiers from T, turning e.g.
 
template<typename ViewType >
using vector_view_value_t = remove_cvref_t< decltype(std::declval< ViewType & >()(0, 0))>
 The plain component type stored by a vector view.
 
template<typename ViewType >
using tensor_view_value_t = remove_cvref_t< decltype(std::declval< ViewType & >()(0, 0, 0))>
 The plain component type stored by a tensor view, recovered from an (entry, row, column) indexing expression the same way vector_view_value_t is from its (entry, component) expression.
 

Functions

template<typename TensorLike >
LIBMESH_DEVICE_INLINE TensorLike::value_type leading_determinant (const TensorLike &T_in, const unsigned int dim=LIBMESH_DIM)
 
template<typename ResultTensor , typename LeftVector , typename RightVector >
LIBMESH_DEVICE_INLINE ResultTensor outer_product (const LeftVector &left, const RightVector &right)
 
template<typename ResultTensor , typename TensorLike >
LIBMESH_DEVICE_INLINE ResultTensor inverse (const TensorLike &T_in, const unsigned int dim=LIBMESH_DIM)
 
template<typename ResultTensor , typename TensorLike >
LIBMESH_DEVICE_INLINE ResultTensor transpose (const TensorLike &T_in)
 
template<typename ResultTensor , typename LeftTensor , typename RightTensor >
LIBMESH_DEVICE_INLINE ResultTensor multiply_tensors (const LeftTensor &left, const RightTensor &right)
 
template<typename ResultVector , typename TensorLike >
LIBMESH_DEVICE_INLINE ResultVector row (const TensorLike &T_in, const unsigned int row_index)
 
template<typename ResultVector , typename TensorLike >
LIBMESH_DEVICE_INLINE ResultVector column (const TensorLike &T_in, const unsigned int col_index)
 
template<typename ResultVector , typename TensorLike , typename VectorLike >
LIBMESH_DEVICE_INLINE ResultVector multiply_tensor_vector (const TensorLike &T_in, const VectorLike &v)
 
template<typename ResultVector , typename VectorLike , typename TensorLike >
LIBMESH_DEVICE_INLINE ResultVector multiply_vector_tensor (const VectorLike &v, const TensorLike &T_in)
 
template<typename LeftTensor , typename RightTensor >
LIBMESH_DEVICE_INLINE void assign_tensor_components (LeftTensor &left, const RightTensor &right)
 Componentwise copy: left = right.
 
template<typename TensorLike , typename Scalar >
LIBMESH_DEVICE_INLINE void fill_tensor_components (TensorLike &T_in, const Scalar &value)
 Sets every component of T_in to value.
 
template<typename LeftTensor , typename RightTensor , typename Scalar >
LIBMESH_DEVICE_INLINE void update_tensor_components (LeftTensor &left, const RightTensor &right, const Scalar &factor)
 Componentwise axpy-style update: left += factor * right.
 
template<typename OutputTensor , typename InputTensor , typename TransformOp >
LIBMESH_DEVICE_INLINE void transform_tensor_components (OutputTensor &out, const InputTensor &in, const TransformOp &op)
 Componentwise transform: out(i,j) = op(in(i,j)).
 
template<typename ResultTensor , typename TensorLike , typename TransformOp >
LIBMESH_DEVICE_INLINE ResultTensor transformed_tensor (const TensorLike &T_in, const TransformOp &op)
 
template<typename LeftTensor , typename RightTensor >
LIBMESH_DEVICE_INLINE bool tensor_equal_impl (const LeftTensor &left, const RightTensor &right)
 
template<typename LeftTensor , typename RightTensor >
LIBMESH_DEVICE_INLINE auto tensor_contract (const LeftTensor &left, const RightTensor &right)
 
template<typename TensorLike >
LIBMESH_DEVICE_INLINE auto tensor_trace (const TensorLike &T_in)
 
template<typename LeftVector , typename RightVector >
LIBMESH_DEVICE_INLINE void assign_vector_components (LeftVector &left, const RightVector &right)
 Componentwise copy: left = right.
 
template<typename VectorLike , typename Scalar >
LIBMESH_DEVICE_INLINE void fill_vector_components (VectorLike &v, const Scalar &value)
 Sets every component of v to value.
 
template<typename LeftVector , typename RightVector , typename Scalar >
LIBMESH_DEVICE_INLINE void update_vector_components (LeftVector &left, const RightVector &right, const Scalar &factor)
 Componentwise axpy-style update: left += factor * right.
 
template<typename OutputVector , typename InputVector , typename TransformOp >
LIBMESH_DEVICE_INLINE void transform_vector_components (OutputVector &out, const InputVector &in, const TransformOp &op)
 Componentwise transform: out(i) = op(in(i)).
 
template<typename ResultVector , typename VectorLike , typename TransformOp >
LIBMESH_DEVICE_INLINE ResultVector transformed_vector (const VectorLike &v, const TransformOp &op)
 
template<typename LeftVector , typename RightVector >
LIBMESH_DEVICE_INLINE bool vector_equal_impl (const LeftVector &left, const RightVector &right)
 

Typedef Documentation

◆ remove_cvref_t

template<typename T >
using libMesh::Kokkos::detail::remove_cvref_t = typedef typename std::remove_cv<typename std::remove_reference<T>::type>::type

Strips reference and const/volatile qualifiers from T, turning e.g.

const Real& into plain Real. Equivalent of C++20's std::remove_cvref_t, hand-rolled while we only require C++17 support.

Definition at line 70 of file kokkos_linalg_base.h.

◆ tensor_view_value_t

template<typename ViewType >
using libMesh::Kokkos::detail::tensor_view_value_t = typedef remove_cvref_t<decltype(std::declval<ViewType &>()(0, 0, 0))>

The plain component type stored by a tensor view, recovered from an (entry, row, column) indexing expression the same way vector_view_value_t is from its (entry, component) expression.

Definition at line 91 of file kokkos_linalg_base.h.

◆ vector_view_value_t

template<typename ViewType >
using libMesh::Kokkos::detail::vector_view_value_t = typedef remove_cvref_t<decltype(std::declval<ViewType &>()(0, 0))>

The plain component type stored by a vector view.

Indexing a view at an (entry, component) pair yields a reference into the view's memory (e.g. Real& , or const Real& for a view of const data), so this strips the reference and any cv-qualifiers to recover the value type itself - the type needed to declare accumulators, make zeros like value_type(0), or materialize owning results.

Definition at line 82 of file kokkos_linalg_base.h.

Function Documentation

◆ assign_tensor_components()

template<typename LeftTensor , typename RightTensor >
LIBMESH_DEVICE_INLINE void libMesh::Kokkos::detail::assign_tensor_components ( LeftTensor &  left,
const RightTensor &  right 
)

Componentwise copy: left = right.

Definition at line 351 of file kokkos_tensor_ops.h.

352{
353 for (unsigned int row = 0; row < LIBMESH_DIM; ++row)
354 for (unsigned int col = 0; col < LIBMESH_DIM; ++col)
355 left(row, col) = right(row, col);
356}
LIBMESH_DEVICE_INLINE ResultVector row(const TensorLike &T_in, const unsigned int row_index)

References row().

Referenced by libMesh::Kokkos::tensor_ref< ViewType >::assign().

◆ assign_vector_components()

template<typename LeftVector , typename RightVector >
LIBMESH_DEVICE_INLINE void libMesh::Kokkos::detail::assign_vector_components ( LeftVector &  left,
const RightVector &  right 
)

Componentwise copy: left = right.

Definition at line 87 of file kokkos_vector_ops.h.

88{
89 for (unsigned int component = 0; component < LIBMESH_DIM; ++component)
90 left(component) = right(component);
91}

Referenced by libMesh::Kokkos::vector_ref< ViewType >::assign().

◆ column()

template<typename ResultVector , typename TensorLike >
LIBMESH_DEVICE_INLINE ResultVector libMesh::Kokkos::detail::column ( const TensorLike &  T_in,
const unsigned int  col_index 
)
Returns
Column col_index of T_in as an owning ResultVector.

Definition at line 289 of file kokkos_tensor_ops.h.

290{
291 ResultVector out;
292 out.zero();
293
294 for (unsigned int row_index = 0; row_index < LIBMESH_DIM; ++row_index)
295 out(row_index) = T_in(row_index, col_index);
296
297 return out;
298}
OStreamProxy out

References libMesh::out.

◆ fill_tensor_components()

template<typename TensorLike , typename Scalar >
LIBMESH_DEVICE_INLINE void libMesh::Kokkos::detail::fill_tensor_components ( TensorLike &  T_in,
const Scalar &  value 
)

Sets every component of T_in to value.

Definition at line 363 of file kokkos_tensor_ops.h.

364{
365 for (unsigned int row = 0; row < LIBMESH_DIM; ++row)
366 for (unsigned int col = 0; col < LIBMESH_DIM; ++col)
367 T_in(row, col) = value;
368}
static const bool value
Definition xdr_io.C:55

References row(), and value.

Referenced by libMesh::Kokkos::tensor_ref< ViewType >::zero().

◆ fill_vector_components()

template<typename VectorLike , typename Scalar >
LIBMESH_DEVICE_INLINE void libMesh::Kokkos::detail::fill_vector_components ( VectorLike &  v,
const Scalar &  value 
)

Sets every component of v to value.

Definition at line 98 of file kokkos_vector_ops.h.

99{
100 for (unsigned int component = 0; component < LIBMESH_DIM; ++component)
101 v(component) = value;
102}

References value.

Referenced by libMesh::Kokkos::vector_ref< ViewType >::zero().

◆ inverse()

template<typename ResultTensor , typename TensorLike >
LIBMESH_DEVICE_INLINE ResultTensor libMesh::Kokkos::detail::inverse ( const TensorLike &  T_in,
const unsigned int  dim = LIBMESH_DIM 
)
Returns
The inverse of the leading dim x dim block of T_in as an owning ResultTensor, computed from the closed-form adjugate for dim <= 3. Components outside the leading block are zero.

Definition at line 170 of file kokkos_tensor_ops.h.

171{
172 static_assert(is_tensor_like_v<TensorLike>, "detail::inverse() requires a tensor-like input");
173
174 ResultTensor out;
175 out.zero();
176
177 if (dim == 0)
178 return out;
179
180 if (dim == 1)
181 {
182 using value_type = typename ResultTensor::value_type;
183 out(0, 0) = value_type(1) / T_in(0, 0);
184 return out;
185 }
186
187 const auto det = leading_determinant(T_in, dim);
188
189 if (dim == 2)
190 {
191 out(0, 0) = T_in(1, 1) / det;
192 out(0, 1) = -T_in(0, 1) / det;
193 out(1, 0) = -T_in(1, 0) / det;
194 out(1, 1) = T_in(0, 0) / det;
195 return out;
196 }
197
198#if LIBMESH_DIM > 2
199 const auto a00 = T_in(0, 0);
200 const auto a01 = T_in(0, 1);
201 const auto a02 = T_in(0, 2);
202 const auto a10 = T_in(1, 0);
203 const auto a11 = T_in(1, 1);
204 const auto a12 = T_in(1, 2);
205 const auto a20 = T_in(2, 0);
206 const auto a21 = T_in(2, 1);
207 const auto a22 = T_in(2, 2);
208
209 out(0, 0) = (a11 * a22 - a12 * a21) / det;
210 out(0, 1) = (a02 * a21 - a01 * a22) / det;
211 out(0, 2) = (a01 * a12 - a02 * a11) / det;
212 out(1, 0) = (a12 * a20 - a10 * a22) / det;
213 out(1, 1) = (a00 * a22 - a02 * a20) / det;
214 out(1, 2) = (a02 * a10 - a00 * a12) / det;
215 out(2, 0) = (a10 * a21 - a11 * a20) / det;
216 out(2, 1) = (a01 * a20 - a00 * a21) / det;
217 out(2, 2) = (a00 * a11 - a01 * a10) / det;
218#else
219 libmesh_ignore(T_in);
220#endif
221
222 return out;
223}
unsigned int dim
LIBMESH_DEVICE_INLINE auto det(const TensorLike &T_in) -> std::enable_if_t< is_tensor_like_v< TensorLike >, decltype(T_in.det())>
void libmesh_ignore(const Args &...)

References libMesh::Kokkos::det(), dim, leading_determinant(), libMesh::libmesh_ignore(), and libMesh::out.

◆ leading_determinant()

template<typename TensorLike >
LIBMESH_DEVICE_INLINE TensorLike::value_type libMesh::Kokkos::detail::leading_determinant ( const TensorLike &  T_in,
const unsigned int  dim = LIBMESH_DIM 
)
Returns
The determinant of the leading dim x dim block of T_in, expanded in closed form for dim <= 3. A 0x0 determinant is 1 by convention.

Definition at line 109 of file kokkos_tensor_ops.h.

110{
111 static_assert(is_tensor_like_v<TensorLike>,
112 "detail::leading_determinant() requires a tensor-like input");
113
114 if (dim == 0)
115 return 1;
116
117 if (dim == 1)
118 return T_in(0, 0);
119
120 if (dim == 2)
121 return T_in(0, 0) * T_in(1, 1) -
122 T_in(0, 1) * T_in(1, 0);
123
124#if LIBMESH_DIM > 2
125 const auto a00 = T_in(0, 0);
126 const auto a01 = T_in(0, 1);
127 const auto a02 = T_in(0, 2);
128 const auto a10 = T_in(1, 0);
129 const auto a11 = T_in(1, 1);
130 const auto a12 = T_in(1, 2);
131 const auto a20 = T_in(2, 0);
132 const auto a21 = T_in(2, 1);
133 const auto a22 = T_in(2, 2);
134
135 return a00 * (a11 * a22 - a12 * a21) -
136 a01 * (a10 * a22 - a12 * a20) +
137 a02 * (a10 * a21 - a11 * a20);
138#else
139 libmesh_ignore(T_in);
140 return 0;
141#endif
142}

References dim, and libMesh::libmesh_ignore().

Referenced by libMesh::Kokkos::tensor_ref< ViewType >::det(), and inverse().

◆ multiply_tensor_vector()

template<typename ResultVector , typename TensorLike , typename VectorLike >
LIBMESH_DEVICE_INLINE ResultVector libMesh::Kokkos::detail::multiply_tensor_vector ( const TensorLike &  T_in,
const VectorLike &  v 
)
Returns
The matrix-vector product T_in * v as an owning ResultVector.

Definition at line 308 of file kokkos_tensor_ops.h.

309{
310 ResultVector out;
311 out.zero();
312
313 for (unsigned int row = 0; row < LIBMESH_DIM; ++row)
314 {
315 auto value = T_in(row, 0) * v(0);
316 for (unsigned int col = 1; col < LIBMESH_DIM; ++col)
317 value += T_in(row, col) * v(col);
318 out(row) = value;
319 }
320
321 return out;
322}

References libMesh::out, row(), and value.

◆ multiply_tensors()

template<typename ResultTensor , typename LeftTensor , typename RightTensor >
LIBMESH_DEVICE_INLINE ResultTensor libMesh::Kokkos::detail::multiply_tensors ( const LeftTensor &  left,
const RightTensor &  right 
)
Returns
The matrix product left * right as an owning ResultTensor.

Definition at line 250 of file kokkos_tensor_ops.h.

251{
252 ResultTensor out;
253 out.zero();
254
255 for (unsigned int row = 0; row < LIBMESH_DIM; ++row)
256 for (unsigned int col = 0; col < LIBMESH_DIM; ++col)
257 {
258 auto value = left(row, 0) * right(0, col);
259 for (unsigned int k = 1; k < LIBMESH_DIM; ++k)
260 value += left(row, k) * right(k, col);
261 out(row, col) = value;
262 }
263
264 return out;
265}

References libMesh::out, row(), and value.

◆ multiply_vector_tensor()

template<typename ResultVector , typename VectorLike , typename TensorLike >
LIBMESH_DEVICE_INLINE ResultVector libMesh::Kokkos::detail::multiply_vector_tensor ( const VectorLike &  v,
const TensorLike &  T_in 
)
Returns
The vector-matrix product v * T_in (i.e. T_in^T * v) as an owning ResultVector.

Definition at line 330 of file kokkos_tensor_ops.h.

331{
332 ResultVector out;
333 out.zero();
334
335 for (unsigned int col = 0; col < LIBMESH_DIM; ++col)
336 {
337 auto value = v(0) * T_in(0, col);
338 for (unsigned int row = 1; row < LIBMESH_DIM; ++row)
339 value += v(row) * T_in(row, col);
340 out(col) = value;
341 }
342
343 return out;
344}

References libMesh::out, row(), and value.

◆ outer_product()

template<typename ResultTensor , typename LeftVector , typename RightVector >
LIBMESH_DEVICE_INLINE ResultTensor libMesh::Kokkos::detail::outer_product ( const LeftVector &  left,
const RightVector &  right 
)
Returns
The outer product left * conj(right)^T as an owning ResultTensor, conjugating the right operand as the host-side outer_product() free function in type_tensor.h does.

Definition at line 151 of file kokkos_tensor_ops.h.

152{
153 ResultTensor out;
154 out.zero();
155
156 for (unsigned int row = 0; row < LIBMESH_DIM; ++row)
157 for (unsigned int col = 0; col < LIBMESH_DIM; ++col)
158 out(row, col) = left(row) * libmesh_conj(right(col));
159
160 return out;
161}
LIBMESH_DEVICE_INLINE T libmesh_conj(T a)

References libMesh::libmesh_conj(), libMesh::out, and row().

◆ row()

template<typename ResultVector , typename TensorLike >
LIBMESH_DEVICE_INLINE ResultVector libMesh::Kokkos::detail::row ( const TensorLike &  T_in,
const unsigned int  row_index 
)
Returns
Row row_index of T_in as an owning ResultVector.

Definition at line 272 of file kokkos_tensor_ops.h.

273{
274 ResultVector out;
275 out.zero();
276
277 for (unsigned int col = 0; col < LIBMESH_DIM; ++col)
278 out(col) = T_in(row_index, col);
279
280 return out;
281}

References libMesh::out.

Referenced by assign_tensor_components(), fill_tensor_components(), multiply_tensor_vector(), multiply_tensors(), multiply_vector_tensor(), outer_product(), tensor_contract(), tensor_equal_impl(), transform_tensor_components(), transpose(), and update_tensor_components().

◆ tensor_contract()

template<typename LeftTensor , typename RightTensor >
LIBMESH_DEVICE_INLINE auto libMesh::Kokkos::detail::tensor_contract ( const LeftTensor &  left,
const RightTensor &  right 
)
Returns
The full contraction (sum of componentwise products) of left with right.

Definition at line 432 of file kokkos_tensor_ops.h.

433{
434 static_assert(is_tensor_like_v<LeftTensor>, "tensor_contract() requires a tensor-like left input");
435 static_assert(is_tensor_like_v<RightTensor>, "tensor_contract() requires a tensor-like right input");
436
437 using sum_type =
438 detail::remove_cvref_t<decltype(left(0, 0) * right(0, 0))>;
439
440 sum_type sum = sum_type(0);
441 for (unsigned int row = 0; row < LIBMESH_DIM; ++row)
442 for (unsigned int col = 0; col < LIBMESH_DIM; ++col)
443 sum += left(row, col) * right(row, col);
444
445 return sum;
446}
typename std::remove_cv< typename std::remove_reference< T >::type >::type remove_cvref_t
Strips reference and const/volatile qualifiers from T, turning e.g.

References row().

Referenced by libMesh::Kokkos::contract().

◆ tensor_equal_impl()

template<typename LeftTensor , typename RightTensor >
LIBMESH_DEVICE_INLINE bool libMesh::Kokkos::detail::tensor_equal_impl ( const LeftTensor &  left,
const RightTensor &  right 
)
Returns
true if left and right agree exactly in every component, false otherwise.

Definition at line 414 of file kokkos_tensor_ops.h.

415{
416 for (unsigned int row = 0; row < LIBMESH_DIM; ++row)
417 for (unsigned int col = 0; col < LIBMESH_DIM; ++col)
418 if (left(row, col) != right(row, col))
419 return false;
420
421 return true;
422}

References row().

Referenced by libMesh::Kokkos::operator==().

◆ tensor_trace()

template<typename TensorLike >
LIBMESH_DEVICE_INLINE auto libMesh::Kokkos::detail::tensor_trace ( const TensorLike &  T_in)
Returns
The trace of T_in.

Definition at line 454 of file kokkos_tensor_ops.h.

455{
456 static_assert(is_tensor_like_v<TensorLike>, "tensor_trace() requires a tensor-like input");
457
458 using trace_type = detail::remove_cvref_t<decltype(T_in(0, 0))>;
459 trace_type sum = trace_type(0);
460 for (unsigned int i = 0; i < LIBMESH_DIM; ++i)
461 sum += T_in(i, i);
462
463 return sum;
464}

Referenced by libMesh::Kokkos::tensor_ref< ViewType >::tr().

◆ transform_tensor_components()

template<typename OutputTensor , typename InputTensor , typename TransformOp >
LIBMESH_DEVICE_INLINE void libMesh::Kokkos::detail::transform_tensor_components ( OutputTensor &  out,
const InputTensor &  in,
const TransformOp &  op 
)

Componentwise transform: out(i,j) = op(in(i,j)).

out and in may alias, as they do in the compound assignment operators below.

Definition at line 388 of file kokkos_tensor_ops.h.

389{
390 for (unsigned int row = 0; row < LIBMESH_DIM; ++row)
391 for (unsigned int col = 0; col < LIBMESH_DIM; ++col)
392 out(row, col) = op(in(row, col));
393}

References libMesh::out, and row().

Referenced by libMesh::Kokkos::operator*=(), libMesh::Kokkos::operator/=(), and transformed_tensor().

◆ transform_vector_components()

template<typename OutputVector , typename InputVector , typename TransformOp >
LIBMESH_DEVICE_INLINE void libMesh::Kokkos::detail::transform_vector_components ( OutputVector &  out,
const InputVector &  in,
const TransformOp &  op 
)

Componentwise transform: out(i) = op(in(i)).

out and in may alias, as they do in the compound assignment operators below.

Definition at line 121 of file kokkos_vector_ops.h.

122{
123 for (unsigned int component = 0; component < LIBMESH_DIM; ++component)
124 out(component) = op(in(component));
125}

References libMesh::out.

Referenced by libMesh::Kokkos::operator*=(), libMesh::Kokkos::operator/=(), and transformed_vector().

◆ transformed_tensor()

template<typename ResultTensor , typename TensorLike , typename TransformOp >
LIBMESH_DEVICE_INLINE ResultTensor libMesh::Kokkos::detail::transformed_tensor ( const TensorLike &  T_in,
const TransformOp &  op 
)
Returns
A new owning ResultTensor with components op(T_in(i,j)).

Definition at line 400 of file kokkos_tensor_ops.h.

401{
402 ResultTensor out;
403 out.zero();
404 transform_tensor_components(out, T_in, op);
405 return out;
406}
LIBMESH_DEVICE_INLINE void transform_tensor_components(OutputTensor &out, const InputTensor &in, const TransformOp &op)
Componentwise transform: out(i,j) = op(in(i,j)).

References libMesh::out, and transform_tensor_components().

◆ transformed_vector()

template<typename ResultVector , typename VectorLike , typename TransformOp >
LIBMESH_DEVICE_INLINE ResultVector libMesh::Kokkos::detail::transformed_vector ( const VectorLike &  v,
const TransformOp &  op 
)
Returns
A new owning ResultVector with components op(v(i)).

Definition at line 132 of file kokkos_vector_ops.h.

133{
134 ResultVector out;
135 out.zero();
136 transform_vector_components(out, v, op);
137 return out;
138}
LIBMESH_DEVICE_INLINE void transform_vector_components(OutputVector &out, const InputVector &in, const TransformOp &op)
Componentwise transform: out(i) = op(in(i)).

References libMesh::out, and transform_vector_components().

◆ transpose()

template<typename ResultTensor , typename TensorLike >
LIBMESH_DEVICE_INLINE ResultTensor libMesh::Kokkos::detail::transpose ( const TensorLike &  T_in)
Returns
The transpose of T_in as an owning ResultTensor.

Definition at line 230 of file kokkos_tensor_ops.h.

231{
232 ResultTensor out;
233 out.zero();
234
235 for (unsigned int row = 0; row < LIBMESH_DIM; ++row)
236 for (unsigned int col = 0; col < LIBMESH_DIM; ++col)
237 out(row, col) = T_in(col, row);
238
239 return out;
240}

References libMesh::out, and row().

◆ update_tensor_components()

template<typename LeftTensor , typename RightTensor , typename Scalar >
LIBMESH_DEVICE_INLINE void libMesh::Kokkos::detail::update_tensor_components ( LeftTensor &  left,
const RightTensor &  right,
const Scalar &  factor 
)

Componentwise axpy-style update: left += factor * right.

Definition at line 375 of file kokkos_tensor_ops.h.

376{
377 for (unsigned int row = 0; row < LIBMESH_DIM; ++row)
378 for (unsigned int col = 0; col < LIBMESH_DIM; ++col)
379 left(row, col) = left(row, col) + factor * right(row, col);
380}

References row().

Referenced by libMesh::Kokkos::tensor_ref< ViewType >::add_scaled(), libMesh::Kokkos::operator+=(), libMesh::Kokkos::operator-=(), and libMesh::Kokkos::tensor_ref< ViewType >::subtract_scaled().

◆ update_vector_components()

template<typename LeftVector , typename RightVector , typename Scalar >
LIBMESH_DEVICE_INLINE void libMesh::Kokkos::detail::update_vector_components ( LeftVector &  left,
const RightVector &  right,
const Scalar &  factor 
)

Componentwise axpy-style update: left += factor * right.

Definition at line 109 of file kokkos_vector_ops.h.

110{
111 for (unsigned int component = 0; component < LIBMESH_DIM; ++component)
112 left(component) = left(component) + factor * right(component);
113}

Referenced by libMesh::Kokkos::vector_ref< ViewType >::add_scaled(), libMesh::Kokkos::operator+=(), libMesh::Kokkos::operator-=(), and libMesh::Kokkos::vector_ref< ViewType >::subtract_scaled().

◆ vector_equal_impl()

template<typename LeftVector , typename RightVector >
LIBMESH_DEVICE_INLINE bool libMesh::Kokkos::detail::vector_equal_impl ( const LeftVector &  left,
const RightVector &  right 
)
Returns
true if left and right agree exactly in every component, false otherwise.

Definition at line 146 of file kokkos_vector_ops.h.

147{
148 for (unsigned int component = 0; component < LIBMESH_DIM; ++component)
149 if (left(component) != right(component))
150 return false;
151
152 return true;
153}

Referenced by libMesh::Kokkos::operator==().