Serialbox  2.2.0
Data serialization library and tools for C/C++, Python and Fortran
IJKBoundary.h
Go to the documentation of this file.
1 //===-- serialbox/core/frontend/stella/IJKBoundary.h --------------------------------*- C++ -*-===//
2 //
3 // S E R I A L B O X
4 //
5 // This file is distributed under terms of BSD license.
6 // See LICENSE.txt for more information
7 //
8 //===------------------------------------------------------------------------------------------===//
9 //
13 //===------------------------------------------------------------------------------------------===//
14 
15 #ifndef SERIALBOX_CORE_FRONTEND_STELLA_IJKBOUNDARY_H
16 #define SERIALBOX_CORE_FRONTEND_STELLA_IJKBOUNDARY_H
17 
18 namespace serialbox {
19 
20 namespace stella {
21 
36 class IJKBoundary {
37 public:
38  IJKBoundary() {
39  iMinusOffset_ = 0;
40  iPlusOffset_ = 0;
41  jMinusOffset_ = 0;
42  jPlusOffset_ = 0;
43  kMinusOffset_ = 0;
44  kPlusOffset_ = 0;
45  }
46 
47  ~IJKBoundary() {}
48 
49  IJKBoundary(const IJKBoundary& other) { *this = other; }
50 
51  IJKBoundary& operator=(const IJKBoundary& other) {
52  iMinusOffset_ = other.iMinusOffset_;
53  iPlusOffset_ = other.iPlusOffset_;
54  jMinusOffset_ = other.jMinusOffset_;
55  jPlusOffset_ = other.jPlusOffset_;
56  kMinusOffset_ = other.kMinusOffset_;
57  kPlusOffset_ = other.kPlusOffset_;
58  return *this;
59  }
60 
61  bool operator==(const IJKBoundary& other) const {
62  return ((iMinusOffset() == other.iMinusOffset()) && (iPlusOffset() == other.iPlusOffset()) &&
63  (jMinusOffset() == other.jMinusOffset()) && (jPlusOffset() == other.jPlusOffset()) &&
64  (kMinusOffset() == other.kMinusOffset()) && (kPlusOffset() == other.kPlusOffset()));
65  }
66 
75  void Init(const int iMinusOffset, const int iPlusOffset, const int jMinusOffset,
76  const int jPlusOffset, const int kMinusOffset, const int kPlusOffset) {
77  iMinusOffset_ = iMinusOffset;
78  iPlusOffset_ = iPlusOffset;
79  jMinusOffset_ = jMinusOffset;
80  jPlusOffset_ = jPlusOffset;
81  kMinusOffset_ = kMinusOffset;
82  kPlusOffset_ = kPlusOffset;
83  }
84 
86  int iMinusOffset() const { return iMinusOffset_; }
87 
89  int iPlusOffset() const { return iPlusOffset_; }
90 
92  int jMinusOffset() const { return jMinusOffset_; }
93 
95  int jPlusOffset() const { return jPlusOffset_; }
96 
98  int kMinusOffset() const { return kMinusOffset_; }
99 
101  int kPlusOffset() const { return kPlusOffset_; }
102 
103 private:
104  int iMinusOffset_;
105  int iPlusOffset_;
106  int jMinusOffset_;
107  int jPlusOffset_;
108  int kMinusOffset_;
109  int kPlusOffset_;
110 };
111 
112 } // namespace stella
113 
114 } // namespace serialbox
115 
116 #endif
int kMinusOffset() const
Offset in k-minus direction.
Definition: IJKBoundary.h:98
int jPlusOffset() const
Offset in j-plus direction.
Definition: IJKBoundary.h:95
Namespace of the STELLA frontend.
Definition: ForwardDecl.h:27
Namespace of the serialbox library.
Definition: Archive.h:25
int jMinusOffset() const
Offset in j-minus direction.
Definition: IJKBoundary.h:92
void Init(const int iMinusOffset, const int iPlusOffset, const int jMinusOffset, const int jPlusOffset, const int kMinusOffset, const int kPlusOffset)
Init the container.
Definition: IJKBoundary.h:75
int kPlusOffset() const
Offset in k-plus direction.
Definition: IJKBoundary.h:101
Container for the boundary size.
Definition: IJKBoundary.h:36
int iPlusOffset() const
Offset in i-plus direction.
Definition: IJKBoundary.h:89
int iMinusOffset() const
Offset in i-minus direction.
Definition: IJKBoundary.h:86