NEMoSys  0.63.0
A modular, extensible resource with robust automated mesh generation, mesh quality analysis, adaptive mesh refinement, and data transfer between arbitrary meshes.
DriverJsonTypeTraits.H
Go to the documentation of this file.
1 /*******************************************************************************
2 * Promesh *
3 * Copyright (C) 2022, IllinoisRocstar LLC. All rights reserved. *
4 * *
5 * Promesh is the property of IllinoisRocstar LLC. *
6 * *
7 * IllinoisRocstar LLC *
8 * Champaign, IL *
9 * www.illinoisrocstar.com *
10 * promesh@illinoisrocstar.com *
11 *******************************************************************************/
12 /*******************************************************************************
13 * This file is part of Promesh *
14 * *
15 * This version of Promesh is free software: you can redistribute it and/or *
16 * modify it under the terms of the GNU Lesser General Public License as *
17 * published by the Free Software Foundation, either version 3 of the License, *
18 * or (at your option) any later version. *
19 * *
20 * Promesh is distributed in the hope that it will be useful, but WITHOUT ANY *
21 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS *
22 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more *
23 * details. *
24 * *
25 * You should have received a copy of the GNU Lesser General Public License *
26 * along with this program. If not, see <https://www.gnu.org/licenses/>. *
27 * *
28 *******************************************************************************/
29 #ifndef NEMOSYS_DRIVERJSONTYPETRAITS_H_
30 #define NEMOSYS_DRIVERJSONTYPETRAITS_H_
31 
32 #include <jsoncons/json.hpp>
33 #include <memory>
34 #include "Drivers/NemJsonMacros.H"
35 
40 #include "Drivers/NemDriver.H"
43 #include "Drivers/TransferDriver.H"
44 
45 #ifdef HAVE_CGNS
46 # define IF_CGNS(a) a,
48 #else
49 # define IF_CGNS(a)
50 #endif
51 
52 #ifdef HAVE_EPIC
53 # define IF_EPIC(a) a,
54 # include "Drivers/InputGenDriver.H"
55 #else
56 # define IF_EPIC(a)
57 #endif
58 
59 #if defined(HAVE_HDF5) && defined(HAVE_GMSH)
60 # define IF_HDF5_GMSH(a) a,
61 # include "Drivers/ProteusDriver.H"
62 #else
63 # define IF_HDF5_GMSH(a)
64 #endif
65 
66 #ifdef HAVE_TEMPLATE_MESH
67 # define IF_TEMPLATE_MESH(a) a,
69 #else
70 # define IF_TEMPLATE_MESH(a)
71 #endif
72 
73 #ifdef HAVE_OCC
74 # define IF_OCC(a) a,
75 # include "Drivers/NucMeshDriver.H"
76 #else
77 # define IF_OCC(a)
78 #endif
79 
80 namespace NEM {
81 namespace DRV {
82 namespace JSON {
83 
84 static constexpr auto programType = "Program Type";
85 static constexpr auto meshFiles = "Mesh File Options";
86 static constexpr auto inMeshFile = "Input Mesh File";
87 static constexpr auto inGeoFile = "Input Geometry File";
88 static constexpr auto outMeshFile = "Output Mesh File";
89 static constexpr auto bmParams = "blockMesh Parameters";
90 static constexpr auto smParams = "snappyHexMesh Parameters";
91 
92 } // namespace JSON
93 } // namespace DRV
94 } // namespace NEM
95 
107  1,
108  (getProgramType, , NEM::DRV::JSON::programType, JSONCONS_RDONLY,
110 
113 
114 JSONCONS_ALL_MEMBER_NAME_TRAITS(NEM::DRV::DriverOutFile,
115  (outputFile, NEM::DRV::JSON::outMeshFile))
116 
117 JSONCONS_ALL_MEMBER_NAME_TRAITS(NEM::DRV::DriverInOutFiles,
118  (inputMeshFile, NEM::DRV::JSON::inMeshFile),
119  (outputMeshFile, NEM::DRV::JSON::outMeshFile))
120 
121 namespace jsoncons {
122 template <typename Json>
123 struct json_type_traits<Json, void *> {
124  static constexpr bool is(const Json &ajson) { return false; }
125  static void *as(const Json &ajson) { return nullptr; }
126  static Json to_json(const void *&aval) { return Json::null(); }
127 };
128 template <>
129 struct is_json_type_traits_declared<void *> : public std::true_type {};
130 } // namespace jsoncons
131 
132 #undef IF_CGNS
133 #undef IF_EPIC
134 #undef IF_HDF5
135 #undef IF_TEMPLATE_MESH
136 #undef IF_OCC
137 
138 #ifdef HAVE_EPIC
139 # include "Drivers/InputGenJson.H"
140 #endif
141 #if defined(HAVE_HDF5) && defined(HAVE_GMSH)
142 # include "Drivers/ProteusJson.H"
143 #endif
144 #ifdef HAVE_CGNS
146 #endif
147 #ifdef HAVE_TEMPLATE_MESH
148 # include "Drivers/TemplateMeshJson.H"
149 #endif
150 #ifdef HAVE_OCC
151 # include "Drivers/NucMeshJson.H"
152 #endif
156 #include "Drivers/MeshQualityJson.H"
159 #include "Drivers/TransferJson.H"
160 
161 #endif // NEMOSYS_DRIVERJSONTYPETRAITS_H_
Driver to read Proteus output.
Definition: ProteusDriver.H:42
#define NEM_JSON_CHECK_KEY_ONLY(x)
base class for drivers
Definition: NemDriver.H:46
static constexpr auto inGeoFile
#define IF_HDF5_GMSH(a)
static constexpr auto inMeshFile
static constexpr auto outMeshFile
static constexpr auto bmParams
#define IF_CGNS(a)
This class drives the flow of pack meshing by using parameters provided by users. ...
This class drives the automatic verification (AV) in Nemosys.
#define IF_OCC(a)
static constexpr auto smParams
Driver class to generate meshes according to a template.
#define IF_EPIC(a)
#define IF_TEMPLATE_MESH(a)
static constexpr auto programType
#define NEM_JSON_WRAP_SMART_PTR(BaseClass, PointerTempl)
Class to create 2d geometry from polygons and circles and mesh it.
Definition: NucMeshDriver.H:50
static constexpr auto meshFiles
#define NEM_JSON_N_GETTER_SETTER_NAME_TRAITS_BASE(BaseClass, ChildClasses, NumMandatoryParams,...)