MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
connectionNode Class Reference

#include <fvstructuredsolverwindowinfo.h>

Public Member Functions

 connectionNode (MInt _nDim)
 
 connectionNode (MInt a, MInt b1, MInt *p1, MInt b2, MInt *p2, MInt _nDim)
 
 connectionNode (MInt a, MInt b1, MInt *p1, MInt b2, MInt *p2, MBool enableSwap, MInt _nDim)
 
void print ()
 
MBool operator< (const connectionNode &entry2) const
 
MBool operator== (const connectionNode &entry2) const
 

Public Attributes

MInt nDim
 
MInt blockId1
 
MInt pos1 [3]
 
MInt blockId2
 
MInt pos2 [3]
 
MInt BC
 
MInt Nstar
 

Detailed Description

Definition at line 28 of file fvstructuredsolverwindowinfo.h.

Constructor & Destructor Documentation

◆ connectionNode() [1/3]

connectionNode::connectionNode ( MInt  _nDim)
inline

Definition at line 37 of file fvstructuredsolverwindowinfo.h.

37 {
38 BC = -1;
39 blockId1 = -1;
40 blockId2 = -1;
41 nDim = _nDim;
42 for(MInt dim = 0; dim < nDim; dim++) {
43 pos1[dim] = -1;
44 pos2[dim] = -1;
45 }
46 Nstar = -1;
47 };
int32_t MInt
Definition: maiatypes.h:62

◆ connectionNode() [2/3]

connectionNode::connectionNode ( MInt  a,
MInt  b1,
MInt p1,
MInt  b2,
MInt p2,
MInt  _nDim 
)
inline

Definition at line 49 of file fvstructuredsolverwindowinfo.h.

49 {
50 BC = a;
51 blockId1 = b1;
52 blockId2 = b2;
53 nDim = _nDim;
54 for(MInt dim = 0; dim < nDim; dim++) {
55 pos1[dim] = p1[dim];
56 pos2[dim] = p2[dim];
57 }
58 Nstar = -1;
59 };
Definition: contexttypes.h:19

◆ connectionNode() [3/3]

connectionNode::connectionNode ( MInt  a,
MInt  b1,
MInt p1,
MInt  b2,
MInt p2,
MBool  enableSwap,
MInt  _nDim 
)
inline

Definition at line 61 of file fvstructuredsolverwindowinfo.h.

61 {
62 MBool swap = false;
63 nDim = _nDim;
64
65 if(enableSwap) {
66 // ensure a fixed order, i.e., lower blockId first or lower pos first if the blockIds match
67 if(b2 < b1) swap = true;
68 if(b1 == b2) {
69 for(MInt countDim = 0; countDim < nDim; ++countDim) {
70 if(p1[countDim] < p2[countDim]) break;
71 if(p1[countDim] > p2[countDim]) {
72 swap = true;
73 break;
74 }
75 }
76 }
77 }
78
79 if(swap) {
80 BC = a;
81 blockId1 = b2;
82 blockId2 = b1;
83 for(MInt dim = 0; dim < nDim; dim++) {
84 pos1[dim] = p2[dim];
85 pos2[dim] = p1[dim];
86 }
87 } else {
88 BC = a;
89 blockId1 = b1;
90 blockId2 = b2;
91 for(MInt dim = 0; dim < nDim; dim++) {
92 pos1[dim] = p1[dim];
93 pos2[dim] = p2[dim];
94 }
95 }
96 Nstar = -1;
97 };
bool MBool
Definition: maiatypes.h:58
void swap(Tensor< TT > &a, Tensor< TT > &b)
Non-member swap exchanges the contents of two Tensors.
Definition: tensor.h:752

Member Function Documentation

◆ operator<()

MBool connectionNode::operator< ( const connectionNode entry2) const
inline

Definition at line 115 of file fvstructuredsolverwindowinfo.h.

115 {
116 if(BC < entry2.BC) {
117 return true;
118 }
119 if(BC > entry2.BC) {
120 return false;
121 }
122 if(blockId1 < entry2.blockId1) {
123 return true;
124 }
125 if(blockId1 > entry2.blockId1) {
126 return false;
127 }
128 if(blockId2 < entry2.blockId2) {
129 return true;
130 }
131 if(blockId2 > entry2.blockId2) {
132 return false;
133 }
134 for(MInt i = 0; i < nDim; ++i) {
135 if(pos1[i] < entry2.pos1[i]) {
136 return true;
137 }
138 if(pos1[i] > entry2.pos1[i]) {
139 return false;
140 }
141 if(pos2[i] < entry2.pos2[i]) {
142 return true;
143 }
144 if(pos2[i] > entry2.pos2[i]) {
145 return false;
146 }
147 }
148 return false;
149 };

◆ operator==()

MBool connectionNode::operator== ( const connectionNode entry2) const
inline

Definition at line 150 of file fvstructuredsolverwindowinfo.h.

150 {
151 if(BC != entry2.BC) {
152 return false;
153 }
154 if(blockId1 != entry2.blockId1) {
155 return false;
156 }
157 if(blockId2 != entry2.blockId2) {
158 return false;
159 }
160 for(MInt i = 0; i < nDim; ++i) {
161 if(pos1[i] != entry2.pos1[i]) {
162 return false;
163 }
164 if(pos2[i] != entry2.pos2[i]) {
165 return false;
166 }
167 }
168 return true;
169 };

◆ print()

void connectionNode::print ( )
inline

Definition at line 99 of file fvstructuredsolverwindowinfo.h.

99 {
100 std::cout << "============================" << std::endl;
101 std::cout << BC << std::endl;
102 std::cout << blockId1;
103 for(MInt dim = 0; dim < nDim; dim++) {
104 std::cout << " " << pos1[dim];
105 }
106 std::cout << std::endl;
107 std::cout << blockId2;
108 for(MInt dim = 0; dim < nDim; dim++) {
109 std::cout << " " << pos2[dim];
110 }
111 std::cout << std::endl;
112 std::cout << "Nstar: " << Nstar << std::endl;
113 std::cout << "============================" << std::endl;
114 };

Member Data Documentation

◆ BC

MInt connectionNode::BC

Definition at line 35 of file fvstructuredsolverwindowinfo.h.

◆ blockId1

MInt connectionNode::blockId1

Definition at line 31 of file fvstructuredsolverwindowinfo.h.

◆ blockId2

MInt connectionNode::blockId2

Definition at line 33 of file fvstructuredsolverwindowinfo.h.

◆ nDim

MInt connectionNode::nDim

Definition at line 30 of file fvstructuredsolverwindowinfo.h.

◆ Nstar

MInt connectionNode::Nstar

Definition at line 36 of file fvstructuredsolverwindowinfo.h.

◆ pos1

MInt connectionNode::pos1[3]

Definition at line 32 of file fvstructuredsolverwindowinfo.h.

◆ pos2

MInt connectionNode::pos2[3]

Definition at line 34 of file fvstructuredsolverwindowinfo.h.


The documentation for this class was generated from the following file: