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.
OmegahRefineDriver.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_OMEGAHREFINEDRIVER_H_
30 #define NEMOSYS_OMEGAHREFINEDRIVER_H_
31 
33 
34 #include <Omega_h_defines.hpp>
35 #include "Mesh/geoMeshBase.H"
37 
38 namespace NEM {
39 namespace DRV {
40 
41 class NEMOSYS_EXPORT OmegahRefineDriver : public RefineDriver {
42  public:
43  struct NEMOSYS_EXPORT Transfer {
44  public:
45  Transfer(std::string arrayName, Omega_h_Transfer method);
46  std::string arrayName{};
47  Omega_h_Transfer method{};
48  jsoncons::optional<std::string> integralName{};
49  JSONCONS_TYPE_TRAITS_FRIEND
50  private:
51  Transfer() = default;
52  };
53  struct NEMOSYS_EXPORT VarCompare : public NEM::SRV::omegahRefineVarCompareOpts {
54  explicit VarCompare(std::string integralName);
55  std::string integralName;
56  JSONCONS_TYPE_TRAITS_FRIEND
57  private:
58  VarCompare() = default;
59  };
60  struct NEMOSYS_EXPORT Opts {
61  public:
62  explicit Opts(std::vector<NEM::SRV::omegahRefineMetricSource> sources);
63  // geoMeshBase
64  bool reconstructGeo{false};
65  // Metric Opts
66  jsoncons::optional<bool> Verbose{};
67  std::vector<NEM::SRV::omegahRefineMetricSource> MetricSources{};
68  jsoncons::optional<bool> ShouldLimitLengths{};
69  jsoncons::optional<Omega_h::Real> MaxLength{};
70  jsoncons::optional<Omega_h::Real> MinLength{};
71  jsoncons::optional<bool> ShouldLimitGradation{};
72  jsoncons::optional<Omega_h::Real> MaxGradationRate{};
73  jsoncons::optional<Omega_h::Real> GradationConvergenceTolerance{};
74  jsoncons::optional<bool> ShouldLimitElementCount{};
75  jsoncons::optional<Omega_h::Real> MaxElementCount{};
76  jsoncons::optional<Omega_h::Real> MinElementCount{};
77  jsoncons::optional<Omega_h::Real> ElementCountOverRelaxation{};
78  jsoncons::optional<Omega_h::Int> NsmoothingSteps{};
79  // Adapt Opts
80  jsoncons::optional<Omega_h::Real> MinLengthDesired{};
81  jsoncons::optional<Omega_h::Real> MaxLengthDesired{};
82  jsoncons::optional<Omega_h::Real> MaxLengthAllowed{};
83  jsoncons::optional<Omega_h::Real> MinQualityAllowed{};
84  jsoncons::optional<Omega_h::Real> MinQualityDesired{};
85  jsoncons::optional<Omega_h::Int> NsliverLayers{};
86  jsoncons::optional<std::string> Verbosity{};
87  jsoncons::optional<Omega_h::Real> LengthHistogramMin{};
88  jsoncons::optional<Omega_h::Real> LengthHistogramMax{};
89  jsoncons::optional<Omega_h::Int> NlengthHistogramBins{};
90  jsoncons::optional<Omega_h::Int> NqualityHistogramBins{};
91  jsoncons::optional<bool> ShouldRefine{};
92  jsoncons::optional<bool> ShouldCoarsen{};
93  jsoncons::optional<bool> ShouldSwap{};
94  jsoncons::optional<bool> ShouldCoarsenSlivers{};
95  jsoncons::optional<bool> ShouldPreventCoarsenFlip{};
96  // Transfer Opts
97  std::vector<Transfer> TransferOpts;
98  std::vector<VarCompare> TransferOptsIntegralDiffuse;
99  JSONCONS_TYPE_TRAITS_FRIEND
100  private:
101  Opts() = default;
102  static constexpr const char *method = "Omega_h";
103  };
104  OmegahRefineDriver(Files files, Opts opts);
105 
106  const Opts &getOpts() const;
107  void setOpts(Opts opts);
108  void execute() const override;
109 
110  JSONCONS_TYPE_TRAITS_FRIEND
111 
112  private:
114 
116 };
117 
118 } // namespace DRV
119 } // namespace NEM
120 
121 #endif // NEMOSYS_OMEGAHREFINEDRIVER_H_
std::vector< VarCompare > TransferOptsIntegralDiffuse
std::vector< Transfer > TransferOpts
Store variables to create Omega_h&#39;s VarCompareOpts object used to define integral diffuse map during ...
std::array< vtkIdType, 2 > sources