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.
HexPackMeshDriver.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_HEXPACKMESHDRIVER_H_
30 #define NEMOSYS_HEXPACKMESHDRIVER_H_
31 
32 #include "nemosys_export.h"
34 
38 
39 namespace NEM {
40 namespace DRV {
41 
42 /**
43  * @details Hexahedral meshing pipeline creates different objects for different
44 meshing engines in NEMoSys, as well as objects of mesh manipulation utilities to
45  complete the meshing workflow.
46  ## Pack Meshing Workflow for Hexahedral Mesh
47  > * Geometry generation using RocPack output file.
48  > * Generation of STL file for workflow downstream.
49  > * Generation of background mesh for snappyHexMesh
50  > * Snapping of pack surfaces onto background volume mesh to create conformal
51 interfaces.
52  > * Splitting multiple pack regions into different cellZones (volumes).
53  > * Merging all different volumes into two different foam mesh (1.
54 Packs, 2. Surrounding)
55  > * Creating patch for Packs and Surrounding regions.
56  > * Conversion of foam mesh to VTK.
57  > * Provides mesh quality statistics to users in a text file.
58  */
59 class NEMOSYS_EXPORT HexPackMeshDriver : public PackMeshDriver {
60  public:
61  struct NEMOSYS_EXPORT Files {
62  public:
63  /**
64  * @brief
65  * @param inputFile Input surface file name
66  * @param isRocpack Boolean for using rocpack to generate an STL
67  * @param outPackMeshFile Pack mesh output filename.extension
68  * @param outSurroundingFile Surrounding mesh output filename.extension
69  */
70  Files(std::string inputFile, bool isRocpack, std::string outPackMeshFile,
71  std::string outSurroundingFile);
72  void setRocpackFile(std::string rocpackFile);
73  void setGeoFile(std::string geoFile);
74  const std::string &getInputFile() const;
75  bool isInputRocpackFile() const;
76  std::string outPackMeshFile{};
77  std::string outSurroundingFile{};
78  /**
79  * @brief Combined mesh file name
80  */
81  std::string outCombinedFile{"PackMesh.vtu"};
82  JSONCONS_TYPE_TRAITS_FRIEND
83  private:
84  Files() = default;
85  std::string rocpackOrGeoFile{};
86  bool useRocpack{};
87  };
88 
89  struct NEMOSYS_EXPORT Opts {
90  public:
95  /**
96  * @brief Perturb location in mesh if snappy fails
97  * @details Ignored if negative
98  */
99  double locAdjust{0.};
100  JSONCONS_TYPE_TRAITS_FRIEND
101  private:
102  static constexpr const char *type = "hexahedral";
103  static constexpr const char *engine = "packmesh";
104  };
105 
106  HexPackMeshDriver(Files files, Opts opts);
107 
108  const Files &getFiles() const;
109  void setFiles(Files files);
110  const Opts &getOpts() const;
111  void setOpts(Opts opts);
112  void execute() const override;
113 
114  JSONCONS_TYPE_TRAITS_FRIEND
115 
116  private:
118 
121 };
122 
123 } // namespace DRV
124 } // namespace NEM
125 
126 #endif // NEMOSYS_HEXPACKMESHDRIVER_H_
snappymeshParams contains all parameters essential for mesh generation using snappymeshGen class meth...
blockMeshParams contains the parameters important for automatic meshing using blockMeshGen class...
static constexpr auto bmParams
This class drives the flow of pack meshing by using parameters provided by users. ...
static constexpr auto smParams