Mallard 0.8.0
Unstructured, GPU accelerated, high-order finite volume CFD solver
Mallard website
Loading...
Searching...
No Matches
zone.h
Go to the documentation of this file.
1
12#ifndef ZONES_H
13#define ZONES_H
14
15#include <string>
16#include <vector>
17
18#include "common.h"
19
20enum class FaceZoneType {
23};
24
25enum class CellZoneType {
26 FLUID
27};
28
29class Zone {
30 public:
34 Zone();
35
39 ~Zone();
40
45 std::string get_name() const;
46
51 void set_name(const std::string& name);
52 protected:
53 private:
54 std::string name;
55};
56
57class FaceZone : public Zone {
58 public:
62 FaceZone();
63
67 ~FaceZone();
68
73 uint32_t n_faces() const;
74
79 FaceZoneType get_type() const;
80
85 void set_type(FaceZoneType type);
86
91
96
97 Kokkos::View<uint32_t *> faces;
98 Kokkos::View<uint32_t *>::host_mirror_type h_faces;
99 protected:
100 private:
101 FaceZoneType type;
102};
103
104class CellZone : public Zone {
105 public:
109 CellZone();
110
114 ~CellZone();
115
120 uint32_t n_cells() const;
121
126 CellZoneType type() const;
127
131 void copy_host_to_device();
132
136 void copy_device_to_host();
137
138 Kokkos::View<uint32_t *> cells;
139 Kokkos::View<uint32_t *>::host_mirror_type h_cells;
140 protected:
141 private:
142 CellZoneType m_type;
143};
144
145#endif // ZONES_H
Definition zone.h:104
CellZoneType type() const
Get the type of the zone.
Definition zone.cpp:70
void copy_host_to_device()
Copy the cells from the host to the device.
Definition zone.cpp:74
uint32_t n_cells() const
Get the number of cells in the zone.
Definition zone.cpp:66
void copy_device_to_host()
Copy the cells from the device to the host.
Definition zone.cpp:78
Kokkos::View< uint32_t * > cells
Definition zone.h:138
CellZone()
Construct a new CellZone object.
Definition zone.cpp:58
Kokkos::View< uint32_t * >::host_mirror_type h_cells
Definition zone.h:139
~CellZone()
Destroy the CellZone object.
Definition zone.cpp:62
Definition zone.h:57
uint32_t n_faces() const
Get the number of faces in the zone.
Definition zone.cpp:38
void set_type(FaceZoneType type)
Set the type of the zone.
Definition zone.cpp:46
FaceZone()
Construct a new FaceZone object.
Definition zone.cpp:30
~FaceZone()
Destroy the FaceZone object.
Definition zone.cpp:34
FaceZoneType get_type() const
Get the type of the zone.
Definition zone.cpp:42
Kokkos::View< uint32_t * > faces
Definition zone.h:97
void copy_device_to_host()
Copy the faces from the device to the host.
Definition zone.cpp:54
Kokkos::View< uint32_t * >::host_mirror_type h_faces
Definition zone.h:98
void copy_host_to_device()
Copy the faces from the host to the device.
Definition zone.cpp:50
Definition zone.h:29
Zone()
Construct a new Zone object.
Definition zone.cpp:14
~Zone()
Destroy the Zone object.
Definition zone.cpp:18
void set_name(const std::string &name)
Set the name of the zone.
Definition zone.cpp:26
std::string get_name() const
Get the name of the zone.
Definition zone.cpp:22
Common header file.
KOKKOS_INLINE_FUNCTION rtype dot(const rtype *a, const rtype *b)
Compute the dot product of two arrays.
Definition common_math.h:32
CellZoneType
Definition zone.h:25
FaceZoneType
Definition zone.h:20