FlexELA
Loading...
Searching...
No Matches
domain.h
1#ifndef DOMAIN_H
2#define DOMAIN_H
3
4#include <vector>
5
6#include "../svector/svector.h"
7#include "fields.h"
8
10namespace domain {
11
16enum Face
17{
18 iMinus,
19 jMinus,
20 kMinus,
21 iPlus,
22 jPlus,
23 kPlus
24};
25
34constexpr Face getOppositeFace(const Face& f)
35{
36 return static_cast<Face>((f + 3) % 6);
37};
38
43struct Domain {
54 Domain(const int& ni, const int& nj, const int& nk, const int& nn);
55
57 const int n[3];
58
60 const int& ni = n[0];
61
63 const int& nj = n[1];
64
66 const int& nk = n[2];
67
69 const int nn;
70
78 std::vector<fields::Owner<svec::SVector>> s;
79
87 std::vector<fields::Owner<svec::NormalizedSVector>> c;
88
97
106
114 constexpr bool hasNeighbor(Face f) const;
115
122 template <class T>
123 T getMax(const T& in) const;
124};
125
126constexpr bool domain::Domain::hasNeighbor(Face f) const
127{
128 return false;
129}
130
131template <class T>
132inline T Domain::getMax(const T& in) const
133{
134 return in;
135}
136
137} // namespace domain
138
139#endif
A helper class to wrap pointers to padded 3D cartesian data.
Definition fields.h:27
Container for ELA Data including its physical structure.
Definition compression.h:6
Face
Corresponds to each of the six faces of the domain.
Definition domain.h:17
constexpr Face getOppositeFace(const Face &f)
Get the Face opposite to Face f.
Definition domain.h:34
A wrapper for global ELA data.
Definition domain.h:43
T getMax(const T &in) const
Get the maximum value across all domains.
Definition domain.h:132
fields::Helper< svec::SVector > getGhost(const Face &f, const int &n)
From s [n], returns ghost cells immediately adjacent to Face f.
std::vector< fields::Owner< svec::SVector > > s
Source vector field.
Definition domain.h:78
constexpr bool hasNeighbor(Face f) const
Determine if there is a neighboring domain on the Face f.
Definition domain.h:126
Domain(const int &ni, const int &nj, const int &nk, const int &nn)
Construct a new Domain object.
const int n[3]
Storage for ni, nj, and nk.
Definition domain.h:57
const int & nj
Number of (non-ghost) cells in second direction.
Definition domain.h:63
std::vector< fields::Owner< svec::NormalizedSVector > > c
Vector dilation field.
Definition domain.h:87
const int & ni
Number of (non-ghost) cells in first direction.
Definition domain.h:60
const int & nk
Number of (non-ghost) cells in third direction.
Definition domain.h:66
fields::Helper< svec::SVector > getEdge(const Face &f, const int &n)
From s [n], returns cells in the domain immediately adjacent to Face f.
const int nn
Number of ELA instances.
Definition domain.h:69