ThunderEgg  1.0.0
NbrType.h
Go to the documentation of this file.
1 /***************************************************************************
2  * ThunderEgg, a library for solvers on adaptively refined block-structured
3  * Cartesian grids.
4  *
5  * Copyright (c) 2020-2021 Scott Aiton
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19  ***************************************************************************/
20 #ifndef THUNDEREGG_NBRTYPE_H
21 #define THUNDEREGG_NBRTYPE_H
22 
27 #include <ThunderEgg/tpl/json.hpp>
28 #include <ostream>
29 
30 namespace ThunderEgg {
34 enum class NbrType
35 {
39  Normal,
43  Coarse,
47  Fine
48 };
52 inline std::ostream&
53 operator<<(std::ostream& os, const NbrType& type)
54 {
55  switch (type) {
56  case NbrType::Coarse:
57  os << "NbrType::Coarse";
58  break;
59  case NbrType::Fine:
60  os << "NbrType::Fine";
61  break;
62  case NbrType::Normal:
63  os << "NbrType::Normal";
64  break;
65  }
66  return os;
67 }
68 NLOHMANN_JSON_SERIALIZE_ENUM(NbrType,
69  { { NbrType::Normal, "NORMAL" },
70  { NbrType::Coarse, "COARSE" },
71  { NbrType::Fine, "FINE" } });
72 } // namespace ThunderEgg
73 #endif
ThunderEgg::NbrType::Coarse
@ Coarse
The neighbor is at a coarser refinement level.
ThunderEgg::NbrType
NbrType
The type of neighbor.
Definition: NbrType.h:34
ThunderEgg
The ThunderEgg namespace.
Definition: BiLinearGhostFiller.h:31
ThunderEgg::NbrType::Fine
@ Fine
The nighbor is at a finer refinement level.
ThunderEgg::NbrType::Normal
@ Normal
The neighbor is at the same refinement level.
ThunderEgg::operator<<
std::ostream & operator<<(std::ostream &os, const Side< 1 > &s)
ostream operator that prints a string representation of side enum.