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.
snappymeshGen.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_SNAPPYMESHGEN_H_
30 #define NEMOSYS_SNAPPYMESHGEN_H_
31 
32 #ifdef HAVE_CFMSH
33 
34 #include "MeshGeneration/meshGen.H"
35 
36 #include <argList.H>
37 #include <fvOptions.H>
38 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//
39 
40 class snappymeshParams;
41 
42 /**
43  @brief snappymeshGen facilitates full-hexahedral/hex-dominent meshing of
44  complex geometries with surface, patch, or region refinement
45  capabilities in addition with adding layers to geometry. A
46  background mesh is needed in order to perform meshing operation.
47  Inputs can be given in form of surface files (.stl, .obj, etc.).
48  Output mesh is written in OpenFOAM polyMesh format.
49  snappymeshGen is based on snappyHexMesh utility of OpenFOAM with
50  following features
51  - Castallated Mesh
52  - Snap
53  - Add Layers
54 **/
55 class snappymeshGen : public meshGen {
56  // --- constructors and destructor
57  public:
58  /** @brief snappymeshGen standard constructor
59  **/
60  snappymeshGen(); // Default constructor
61 
62  /** @brief snappymeshGen alternate constructor
63  @param params snappymeshParams object
64  **/
65  snappymeshGen(snappymeshParams *params); // Constructors w/ Parameters
66 
67  /** @brief snappymeshGen standard destructor
68  **/
69  ~snappymeshGen(); // destructor
70 
71  // --- access
72  public:
73  /** @brief Creates mesh from input STL file
74  **/
75  int createMeshFromSTL(const char *fname) override;
76 
77  private:
78  /** @brief Initializes OpenFOAM environment
79  **/
80  void initialize();
81 
82  /** @brief Creates snappyHexMeshDict for meshing operation
83  **/
84  void createSnappyDict(const bool &write);
85 
86  private:
87  /** @brief If enabled, generated mesh using default parameters
88  **/
89  bool defaults; // Default scenario
90 
91  /** @brief snappymeshParams object Parameters
92  **/
93  snappymeshParams *params_; // SnappyHexMesh Parameters
94 
95  // -- OpenFOAM Data Structure
96  private:
97  std::unique_ptr<Foam::dictionary> controlDict_;
98  std::unique_ptr<Foam::dictionary> fvSchemes_;
99  std::unique_ptr<Foam::dictionary> fvSolution_;
100  std::unique_ptr<Foam::dictionary> snappyMshDict_;
101  std::unique_ptr<Foam::Time> runTime_;
102  std::unique_ptr<Foam::fvMesh> fmesh_;
103 };
104 
105 #endif
106 
107 #endif // NEMOSYS_SNAPPYMESHGEN_H_
snappymeshGen facilitates full-hexahedral/hex-dominent meshing of complex geometries with surface...
Definition: snappymeshGen.H:55
snappymeshParams contains all parameters essential for mesh generation using snappymeshGen class meth...
bool defaults
If enabled, generated mesh using default parameters.
Definition: snappymeshGen.H:89
int createMeshFromSTL(const char *fname) override
Creates mesh from input STL file.
Definition: snappymeshGen.C:91
std::unique_ptr< Foam::Time > runTime_
std::unique_ptr< Foam::dictionary > fvSchemes_
Definition: snappymeshGen.H:98
std::unique_ptr< Foam::dictionary > snappyMshDict_
std::unique_ptr< Foam::dictionary > fvSolution_
Definition: snappymeshGen.H:99
~snappymeshGen()
snappymeshGen standard destructor
Definition: snappymeshGen.C:65
void createSnappyDict(const bool &write)
Creates snappyHexMeshDict for meshing operation.
std::unique_ptr< Foam::fvMesh > fmesh_
snappymeshParams * params_
snappymeshParams object Parameters
Definition: snappymeshGen.H:93
std::unique_ptr< Foam::dictionary > controlDict_
Definition: snappymeshGen.H:97
snappymeshGen()
snappymeshGen standard constructor
Definition: snappymeshGen.C:49
void initialize()
Initializes OpenFOAM environment.
Definition: snappymeshGen.C:67