Go to the documentation of this file.
21 #ifndef __symArray_hpp__
22 #define __symArray_hpp__
35 template<
typename Type>
37 void SWAP(Type &x, Type& y)
53 template<
typename T,
typename MemorySpace=
void>
92 return memory_space::name();
133 "error in creating symArray " << name <<
endl;
158 Kokkos::deep_copy(
view_, val);
182 "size of input vector do not match a symetric array "<< nElem<<
endl;
193 Kokkos::realloc(
view_, nElem );
197 Kokkos::deep_copy(
view_, temp);
209 if( !vecFromFile.
read(is) )
return false;
211 this->
assign(vecFromFile);
225 Kokkos::deep_copy(mirror,dVec);
227 return vecToFile.
write(os);
240 real nr = 0.5*(
sqrt(8.0*nElem+1)-1);
242 if(
equal(nr-
static_cast<real>(
n) , 0.0) )
return true;
250 template<
typename T,
typename MemorySpace>
261 template<
typename T,
typename MemorySpace>
265 if( !oArr.
write(os) )
276 #endif //__symArray_hpp__
const INLINE_FUNCTION_HD T & operator()(uint32 i, uint32 j) const
nonLinearProperties & reference
nonLinearProperties * iterator
INLINE_FUNCTION_H symArray()
INLINE_FUNCTION_H symArray(word name, const Vector< T > &src)
INLINE_FUNCTION_H symArray(word name, uint32 n)
#define fatalExit
Fatal exit.
FUNCTION_H bool read(iIstream &is)
INLINE_FUNCTION_H symArray(uint32 n)
Vector< T, Allocator > sqrt(const Vector< T, Allocator > &v)
constexpr static const char * memoerySpaceName()
Kokkos::pair< T1, T2 > Pair
Pair of two variables.
typename ViewType::device_type deviceType
INLINE_FUNCTION_HD bool equal(const box &b1, const box &b2, real tol=smallValue)
typename ViewType::execution_space execution_space
INLINE_FUNCTION_HD ~symArray()=default
auto size() const
Size of the vector.
iOstream & endl(iOstream &os)
Add newline and flush stream.
static bool getN(uint32 nElem, uint32 &n)
INLINE_FUNCTION_HD T & operator()(uint32 i, uint32 j)
nonLinearProperties * pointer
INLINE_FUNCTION_HD void SWAP(Type &x, Type &y)
bool assign(const Vector< T > src)
INLINE_FUNCTION_H symArray(word name, uint32 n, const T &val)
Interface class for any input stream
#define fatalErrorInFunction
Report a fatal error and function name and exit the application.
const nonLinearProperties & constReference
INLINE_FUNCTION iIstream & operator>>(iIstream &str, AB3History &ab3)
typename ViewType::memory_space memory_space
FUNCTION_H bool write(iOstream &os) const
#define INLINE_FUNCTION_H
INLINE_FUNCTION iOstream & operator<<(iOstream &str, const AB3History &ab3)
const nonLinearProperties * constPointer
virtual const word & name() const
Return the name of the stream.
const nonLinearProperties * constIterator
Kokkos::View< T *, properties... > ViewType1D
1D veiw as a vector
Kokkos::View< T *, Kokkos::HostSpace > hostViewType1D
1D array (vector with host memeory space)
bool write(iOstream &os) const
ViewType1D< nonLinearProperties, void > ViewType
static INLINE_FUNCTION_HD uint32 numElem(uint32 n)
INLINE_FUNCTION_HD symArray & operator=(const symArray &)=default
#define ioErrorInFile(fileName, lineNumber)
Report an error in file operation with supplied fileName and lineNumber.
int32 lineNumber() const
Const access to the current stream line number.
#define INLINE_FUNCTION_HD
nonLinearProperties valueType
TypeInfoTemplateNV111("symArray", T, memoerySpaceName())
Interface class for any output stream.