Mallard 0.8.0
Unstructured, GPU accelerated, high-order finite volume CFD solver
Mallard website
Loading...
Searching...
No Matches
data.h
Go to the documentation of this file.
1
12#ifndef DATA_H
13#define DATA_H
14
15#include <string>
16
17#include <Kokkos_Core.hpp>
18
19#include "common_typedef.h"
20
21class Data {
22 public:
28 Data(std::string name, Kokkos::View<rtype *, Kokkos::LayoutStride>::host_mirror_type view) :
30 // Empty
31 }
32
37 // Empty
38 }
39
45 rtype & operator[](size_t i) const {
46 // Account for size of conservative state arrays
47 return m_view(i);
48 }
49
54 std::string name() const {
55 return m_name;
56 }
57 protected:
58 std::string m_name;
59 Kokkos::View<rtype *, Kokkos::LayoutStride>::host_mirror_type m_view;
60 private:
61};
62
63#endif // DATA_H
Definition data.h:21
std::string m_name
Definition data.h:58
Data(std::string name, Kokkos::View< rtype *, Kokkos::LayoutStride >::host_mirror_type view)
Construct a new Data object.
Definition data.h:28
~Data()
Destroy the Data object.
Definition data.h:36
std::string name() const
Get the name of the data array.
Definition data.h:54
rtype & operator[](size_t i) const
Access element of data array.
Definition data.h:45
Kokkos::View< rtype *, Kokkos::LayoutStride >::host_mirror_type m_view
Definition data.h:59
KOKKOS_INLINE_FUNCTION rtype dot(const rtype *a, const rtype *b)
Compute the dot product of two arrays.
Definition common_math.h:32
Typedefs for common types.
float rtype
Definition common_typedef.h:39