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.
blockMeshGen.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_BLOCKMESHGEN_H_
30 #define NEMOSYS_BLOCKMESHGEN_H_
31 
32 #ifdef HAVE_CFMSH
33 
34 // Nemosys Headers
35 #include "MeshGeneration/meshGen.H"
36 #include "Mesh/geoMeshBase.H"
37 #include "Mesh/foamGeoMesh.H"
38 
39 // Foam headers
40 #include <argList.H>
41 #include <fvOptions.H>
42 
43 //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//
44 
45 class blockMeshParams; // Friend Class
46 
47 /**
48  @brief blockMeshGen <-- meshGen <-- meshBase
49  This class incorporates mesh generating method of blockMesh utility.
50  Currently, we are supporting automatic full-hex mesh generation
51  Box, Sphere, Cylinder, and Tapered Cone geometries. Output mesh is
52  written in OpenFOAM polyMesh format.
53 **/
54 class blockMeshGen : public meshGen {
55  // --- constructors and destructor
56  public:
57  /** @brief blockMeshGen standard constructor
58  **/
59  blockMeshGen(); // Default constructor
60 
61  /** @brief blockMeshGen alternate constructor. Uses user-defined parameters
62  to perform requested meshing operation.
63  @param params blockMeshParams object
64  **/
65  blockMeshGen(blockMeshParams *params); // Constructor with parameters
66 
67  /** @brief blockMeshGen standard desctructor
68  **/
69  ~blockMeshGen(); // Class destructor
70 
71  // -- meshGen methods override
72  public:
73  /** @brief Generates mesh and returns VTK database
74  @param fname Input surface file name
75  @return meshBase mesh dataset
76  **/
77  int createMeshFromSTL(const char *fname);
78 
79  // -- Internal
80  private:
81  /**
82  @brief Initializes OpenFOAM args and runtime
83  **/
84  void initialize();
85 
86  /**
87  @brief Creates blockMeshDict from user arguments
88  **/
89  void createBlockMshDict(const bool &write);
90 
91  // --- Internal Use
92  private:
93  bool defaults; // Default parameters boolean
94 
95  /** @brief Definition of parameters pointer
96  **/
97  blockMeshParams *params_; // Definition of parameters pointer
98 
99  // --- OpenFOAM Data Structure
100  private:
101  std::unique_ptr<Foam::Time> runTime_;
102  std::unique_ptr<Foam::fvMesh> fmesh_;
103  std::unique_ptr<Foam::dictionary> blockMshDict_;
104  std::unique_ptr<Foam::dictionary> controlDict_;
105  std::unique_ptr<Foam::dictionary> fvSchemes_;
106  std::unique_ptr<Foam::dictionary> fvSolution_;
107 };
108 
109 #endif
110 
111 #endif // NEMOSYS_BLOCKMESHGEN_H_
std::unique_ptr< Foam::fvMesh > fmesh_
Definition: blockMeshGen.H:102
blockMeshGen <– meshGen <– meshBase This class incorporates mesh generating method of blockMesh uti...
Definition: blockMeshGen.H:54
std::unique_ptr< Foam::Time > runTime_
Definition: blockMeshGen.H:101
std::unique_ptr< Foam::dictionary > fvSchemes_
Definition: blockMeshGen.H:105
std::unique_ptr< Foam::dictionary > blockMshDict_
Definition: blockMeshGen.H:103
blockMeshParams * params_
Definition of parameters pointer.
Definition: blockMeshGen.H:97
blockMeshParams contains the parameters important for automatic meshing using blockMeshGen class...
~blockMeshGen()
blockMeshGen standard desctructor
Definition: blockMeshGen.C:73
std::unique_ptr< Foam::dictionary > fvSolution_
Definition: blockMeshGen.H:106
void initialize()
Initializes OpenFOAM args and runtime.
Definition: blockMeshGen.C:75
int createMeshFromSTL(const char *fname)
Generates mesh and returns VTK database.
Definition: blockMeshGen.C:98
void createBlockMshDict(const bool &write)
Creates blockMeshDict from user arguments.
Definition: blockMeshGen.C:124
blockMeshGen()
blockMeshGen standard constructor
Definition: blockMeshGen.C:56
std::unique_ptr< Foam::dictionary > controlDict_
Definition: blockMeshGen.H:104