| 77 | |
| 78 | //- Identify cell faces in terms of cell Id and face Id |
| 79 | class cellFaceIdentifier |
| 80 | { |
| 81 | public: |
| 82 | // Public data |
| 83 | |
| 84 | //- Cell Id |
| 85 | label cell; |
| 86 | |
| 87 | //- Face Id |
| 88 | label face; |
| 89 | |
| 90 | |
| 91 | // Constructors |
| 92 | |
| 93 | //- Construct null |
| 94 | cellFaceIdentifier() : cell(-1), face(-1) {} |
| 95 | |
| 96 | //- Construct from cell/face components |
| 97 | cellFaceIdentifier(label c, label f) : cell(c), face(f) {} |
| 98 | |
| 99 | |
| 100 | // Check |
| 101 | |
| 102 | //- Used if cell or face are non-negative |
| 103 | bool used() const |
| 104 | { |
| 105 | return (cell >= 0 && face >= 0); |
| 106 | } |
| 107 | |
| 108 | //- Unused if cell or face are negative |
| 109 | bool unused() const |
| 110 | { |
| 111 | return (cell < 0 || face < 0); |
| 112 | } |
| 113 | |
| 114 | |
| 115 | // Member Operators |
| 116 | |
| 117 | bool operator!=(const cellFaceIdentifier& cf) const |
| 118 | { |
| 119 | return (cell != cf.cell || face != cf.face); |
| 120 | } |
| 121 | |
| 122 | bool operator==(const cellFaceIdentifier& cf) const |
| 123 | { |
| 124 | return (cell == cf.cell && face == cf.face); |
| 125 | } |
| 126 | |
| 127 | // IOstream Operators |
| 128 | |
| 129 | friend Ostream& operator<< |
| 130 | ( |
| 131 | Ostream& os, |
| 132 | const cellFaceIdentifier& cf |
| 133 | ) |
| 134 | { |
| 135 | os << "(" << cf.cell << "/" << cf.face << ")"; |
| 136 | return os; |
no outgoing calls
no test coverage detected