https://mooseframework.inl.gov
Public Member Functions | Public Attributes | List of all members
Moose::Kokkos::Real3 Struct Reference

#include <KokkosTypes.h>

Public Member Functions

KOKKOS_INLINE_FUNCTION Real3 ()
 
KOKKOS_INLINE_FUNCTION Real3 (const Real &scalar)
 
KOKKOS_INLINE_FUNCTION Real3 (const Real3 &vector)
 
KOKKOS_INLINE_FUNCTION Real3 (const Real &x, const Real &y, const Real &z)
 
 Real3 (const libMesh::TypeVector< Real > &vector)
 
KOKKOS_INLINE_FUNCTION Realoperator() (unsigned int i)
 
KOKKOS_INLINE_FUNCTION Real operator() (unsigned int i) const
 
KOKKOS_INLINE_FUNCTION Real3operator= (const Real3 &vector)
 
KOKKOS_INLINE_FUNCTION Real3operator= (const Real scalar)
 
Real3operator= (const libMesh::TypeVector< Real > &vector)
 
KOKKOS_INLINE_FUNCTION void operator+= (const Real scalar)
 
KOKKOS_INLINE_FUNCTION void operator+= (const Real3 vector)
 
KOKKOS_INLINE_FUNCTION void operator-= (const Real scalar)
 
KOKKOS_INLINE_FUNCTION void operator-= (const Real3 vector)
 
KOKKOS_INLINE_FUNCTION void operator*= (const Real scalar)
 
KOKKOS_INLINE_FUNCTION Real norm ()
 
KOKKOS_INLINE_FUNCTION Real dot_product (const Real3 vector)
 
KOKKOS_INLINE_FUNCTION Real3 cross_product (const Real3 vector)
 
KOKKOS_INLINE_FUNCTION Real33 cartesian_product (const Real3 vector)
 

Public Attributes

Real v [3]
 

Detailed Description

Definition at line 126 of file KokkosTypes.h.

Constructor & Destructor Documentation

◆ Real3() [1/5]

KOKKOS_INLINE_FUNCTION Moose::Kokkos::Real3::Real3 ( )
inline

Definition at line 131 of file KokkosTypes.h.

132  {
133  v[0] = 0;
134  v[1] = 0;
135  v[2] = 0;
136  }

◆ Real3() [2/5]

KOKKOS_INLINE_FUNCTION Moose::Kokkos::Real3::Real3 ( const Real scalar)
inline

Definition at line 137 of file KokkosTypes.h.

138  {
139  v[0] = scalar;
140  v[1] = scalar;
141  v[2] = scalar;
142  }

◆ Real3() [3/5]

KOKKOS_INLINE_FUNCTION Moose::Kokkos::Real3::Real3 ( const Real3 vector)
inline

Definition at line 143 of file KokkosTypes.h.

144  {
145  v[0] = vector.v[0];
146  v[1] = vector.v[1];
147  v[2] = vector.v[2];
148  }

◆ Real3() [4/5]

KOKKOS_INLINE_FUNCTION Moose::Kokkos::Real3::Real3 ( const Real x,
const Real y,
const Real z 
)
inline

Definition at line 149 of file KokkosTypes.h.

150  {
151  v[0] = x;
152  v[1] = y;
153  v[2] = z;
154  }

◆ Real3() [5/5]

Moose::Kokkos::Real3::Real3 ( const libMesh::TypeVector< Real > &  vector)
inline

Definition at line 155 of file KokkosTypes.h.

156  {
157  v[0] = vector(0);
158  v[1] = vector(1);
159  v[2] = vector(2);
160  }

Member Function Documentation

◆ cartesian_product()

KOKKOS_INLINE_FUNCTION Real33 Moose::Kokkos::Real3::cartesian_product ( const Real3  vector)
inline

Definition at line 234 of file KokkosTypes.h.

235  {
236  Real33 tensor;
237 
238  for (unsigned int i = 0; i < 3; ++i)
239  for (unsigned int j = 0; j < 3; ++j)
240  tensor(i, j) = v[i] * vector.v[j];
241 
242  return tensor;
243  }

◆ cross_product()

KOKKOS_INLINE_FUNCTION Real3 Moose::Kokkos::Real3::cross_product ( const Real3  vector)
inline

Definition at line 224 of file KokkosTypes.h.

225  {
226  Real3 cross;
227 
228  cross.v[0] = v[1] * vector.v[2] - v[2] * vector.v[1];
229  cross.v[1] = v[2] * vector.v[0] - v[0] * vector.v[2];
230  cross.v[2] = v[0] * vector.v[1] - v[1] * vector.v[0];
231 
232  return cross;
233  }
KOKKOS_INLINE_FUNCTION Real3()
Definition: KokkosTypes.h:131

◆ dot_product()

KOKKOS_INLINE_FUNCTION Real Moose::Kokkos::Real3::dot_product ( const Real3  vector)
inline

Definition at line 220 of file KokkosTypes.h.

221  {
222  return v[0] * vector.v[0] + v[1] * vector.v[1] + v[2] * vector.v[2];
223  }

◆ norm()

KOKKOS_INLINE_FUNCTION Real Moose::Kokkos::Real3::norm ( )
inline

Definition at line 219 of file KokkosTypes.h.

219 { return std::sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]); }
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template * sqrt(_arg)) *_arg.template D< dtag >()) CT_SIMPLE_UNARY_FUNCTION(tanh

◆ operator()() [1/2]

KOKKOS_INLINE_FUNCTION Real& Moose::Kokkos::Real3::operator() ( unsigned int  i)
inline

Definition at line 162 of file KokkosTypes.h.

162 { return v[i]; }

◆ operator()() [2/2]

KOKKOS_INLINE_FUNCTION Real Moose::Kokkos::Real3::operator() ( unsigned int  i) const
inline

Definition at line 163 of file KokkosTypes.h.

163 { return v[i]; }

◆ operator*=()

KOKKOS_INLINE_FUNCTION void Moose::Kokkos::Real3::operator*= ( const Real  scalar)
inline

Definition at line 213 of file KokkosTypes.h.

214  {
215  v[0] *= scalar;
216  v[1] *= scalar;
217  v[2] *= scalar;
218  }

◆ operator+=() [1/2]

KOKKOS_INLINE_FUNCTION void Moose::Kokkos::Real3::operator+= ( const Real  scalar)
inline

Definition at line 189 of file KokkosTypes.h.

190  {
191  v[0] += scalar;
192  v[1] += scalar;
193  v[2] += scalar;
194  }

◆ operator+=() [2/2]

KOKKOS_INLINE_FUNCTION void Moose::Kokkos::Real3::operator+= ( const Real3  vector)
inline

Definition at line 195 of file KokkosTypes.h.

196  {
197  v[0] += vector.v[0];
198  v[1] += vector.v[1];
199  v[2] += vector.v[2];
200  }

◆ operator-=() [1/2]

KOKKOS_INLINE_FUNCTION void Moose::Kokkos::Real3::operator-= ( const Real  scalar)
inline

Definition at line 201 of file KokkosTypes.h.

202  {
203  v[0] -= scalar;
204  v[1] -= scalar;
205  v[2] -= scalar;
206  }

◆ operator-=() [2/2]

KOKKOS_INLINE_FUNCTION void Moose::Kokkos::Real3::operator-= ( const Real3  vector)
inline

Definition at line 207 of file KokkosTypes.h.

208  {
209  v[0] -= vector.v[0];
210  v[1] -= vector.v[1];
211  v[2] -= vector.v[2];
212  }

◆ operator=() [1/3]

KOKKOS_INLINE_FUNCTION Real3& Moose::Kokkos::Real3::operator= ( const Real3 vector)
inline

Definition at line 165 of file KokkosTypes.h.

166  {
167  v[0] = vector.v[0];
168  v[1] = vector.v[1];
169  v[2] = vector.v[2];
170 
171  return *this;
172  }

◆ operator=() [2/3]

KOKKOS_INLINE_FUNCTION Real3& Moose::Kokkos::Real3::operator= ( const Real  scalar)
inline

Definition at line 173 of file KokkosTypes.h.

174  {
175  v[0] = scalar;
176  v[1] = scalar;
177  v[2] = scalar;
178 
179  return *this;
180  }

◆ operator=() [3/3]

Real3& Moose::Kokkos::Real3::operator= ( const libMesh::TypeVector< Real > &  vector)
inline

Definition at line 181 of file KokkosTypes.h.

182  {
183  v[0] = vector(0);
184  v[1] = vector(1);
185  v[2] = vector(2);
186 
187  return *this;
188  }

Member Data Documentation

◆ v

Real Moose::Kokkos::Real3::v[3]

The documentation for this struct was generated from the following file: