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.
gmshGen.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_GMSHGEN_H_
30 #define NEMOSYS_GMSHGEN_H_
31 
32 #include "MeshGeneration/meshGen.H"
33 
34 namespace NEM {
35 
36 namespace GEN {
37 
38 class gmshParams;
39 
40 class gmshGen : public meshGen {
41  public:
42  /** @brief gmshGen default constructor
43  **/
44  gmshGen();
45 
46  /** @brief gmshGen alternate constructor with parameters
47 @param params gmshParams object
48 **/
49  gmshGen(gmshParams *params);
50 
51  /** @brief gmshGen standard destructor
52  **/
53  ~gmshGen();
54 
55  public:
56  /** @brief Creates mesh from input STEP file
57  @param fname The input STEP file
58  **/
59  int createMeshFromSTL(const char *fname) override;
60 
61  int createMeshFromSTEP(const char *fname);
62 
63  public:
64 
65  /** @brief Get filename of generated .msh file
66  **/
67  const std::string &getMshFilename() const { return mshFname; }
68 
69  private:
70  /** @brief Sets the global geometry and meshing options
71  **/
72  void globalOptions();
73 
74  /** @brief Gets geometry entitiy names of STEP geometry
75  **/
76  void getGeomNames();
77 
78  /** @brief Gets the surface colors of STEP geometry
79  **/
80  void getSurfaceColors();
81 
82  /** @brief Applies mesh size fields
83  **/
84  void meshSizeFields();
85 
86  /** @brief Applies physical names based on color
87  **/
88  void applyColorNames();
89 
90  /** @brief Applies transfinite settings to prescribed hexahedral volumes
91  **/
93 
94  /** @brief gmshParams object Parameters
95  **/
96  gmshParams *meshParams; // Gmsh Parameters
97 
98  /** @brief Name of .msh file output by gmsh
99  */
100  std::string mshFname;
101 };
102 
103 } // namespace GEN
104 
105 } // namespace NEM
106 
107 #endif // NEMOSYS_GMSHGEN_H_
~gmshGen()
gmshGen standard destructor
Definition: gmshGen.C:58
std::string mshFname
Name of .msh file output by gmsh.
Definition: gmshGen.H:100
void globalOptions()
Sets the global geometry and meshing options.
Definition: gmshGen.C:150
int createMeshFromSTL(const char *fname) override
Creates mesh from input STEP file.
Definition: gmshGen.C:60
gmshGen()
gmshGen default constructor
Definition: gmshGen.C:51
void meshSizeFields()
Applies mesh size fields.
Definition: gmshGen.C:267
void getSurfaceColors()
Gets the surface colors of STEP geometry.
Definition: gmshGen.C:250
void applyTransfiniteVolumes()
Applies transfinite settings to prescribed hexahedral volumes.
Definition: gmshGen.C:471
gmshParams contains all parameters essential for mesh generation using gmshGen class methods...
Definition: gmshParams.H:92
int createMeshFromSTEP(const char *fname)
Definition: gmshGen.C:69
void applyColorNames()
Applies physical names based on color.
Definition: gmshGen.C:404
void getGeomNames()
Gets geometry entitiy names of STEP geometry.
Definition: gmshGen.C:232
const std::string & getMshFilename() const
Get filename of generated .msh file.
Definition: gmshGen.H:67
gmshParams * meshParams
gmshParams object Parameters
Definition: gmshGen.H:96