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.
MeshQualityDriver.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_MESHQUALITYDRIVER_H_
30 #define NEMOSYS_MESHQUALITYDRIVER_H_
31 
32 #include "nemosys_export.h"
33 #include "Drivers/NemDriver.H"
34 
35 #include "Mesh/meshBase.H"
36 #ifdef HAVE_CFMSH
38 #endif
39 
40 namespace NEM {
41 namespace DRV {
42 
43 class NEMOSYS_EXPORT MeshQualityDriver : public NemDriver {
44  JSONCONS_TYPE_TRAITS_FRIEND
45  private:
46  static constexpr const char *programType = "Mesh Quality";
47  jsoncons::string_view getProgramType() const override;
48 };
49 
50 class NEMOSYS_EXPORT CheckMeshQualDriver : public MeshQualityDriver {
51  public:
52  struct NEMOSYS_EXPORT Files {
53  public:
54  Files(std::string input, std::string output);
55  std::string inputMeshFile{};
56  std::string outputFile{};
57  JSONCONS_TYPE_TRAITS_FRIEND
58  private:
59  Files() = default;
60  };
61  explicit CheckMeshQualDriver(Files files);
62 
63  const Files &getFiles() const;
64  void setFiles(Files files);
65 
66  JSONCONS_TYPE_TRAITS_FRIEND
67 
68  private:
70 
72 
73  void execute() const override;
74 
75  public:
76  struct NEMOSYS_NO_EXPORT Opts {
77  static constexpr const char *meshQualityEngine = "default";
78  };
79 
80  private:
81  static Opts getOpts();
82 };
83 
84 #ifdef HAVE_CFMSH
85 
86 class NEMOSYS_EXPORT OptimizeMeshQualDriver : public MeshQualityDriver {
87  public:
88  explicit OptimizeMeshQualDriver(std::vector<cfmeshQualityParams> params);
89 
90  const std::vector<cfmeshQualityParams> &getParams() const;
91  void setParams(std::vector<cfmeshQualityParams> params);
92  void addParams(cfmeshQualityParams params);
93  void execute() const override;
94 
95  JSONCONS_TYPE_TRAITS_FRIEND
96 
97  private:
99 
100  public:
101  struct NEMOSYS_NO_EXPORT Opts {
102  public:
103  explicit Opts(std::vector<cfmeshQualityParams> params);
104  // Change this to std::vector<std::shared_ptr<meshQualityParams>> (or
105  // std::vector<std::variant<>>) to support multiple methods in the future
106  std::vector<cfmeshQualityParams> params{};
107  JSONCONS_TYPE_TRAITS_FRIEND
108  private:
109  Opts() = default;
110  static constexpr const char *meshQualityEngine = "cfmesh";
111  };
112 
113  private:
115  const Opts &getOpts() const;
116  void setOpts(Opts opts);
117 };
118 #endif
119 
120 } // namespace DRV
121 } // namespace NEM
122 
123 #endif // NEMOSYS_MESHQUALITYDRIVER_H_
base class for drivers
Definition: NemDriver.H:46
static constexpr auto programType