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.
cfmeshGen.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_CFMESHGEN_H_
30 #define NEMOSYS_CFMESHGEN_H_
31 
32 #ifdef HAVE_CFMSH
33 
34 #include "MeshGeneration/meshGen.H"
35 
36 // OpenFOAM headers
37 #include <argList.H>
38 #include <fvOptions.H>
39 
40 class cfmeshParams;
41 
42 class cfmeshGen : public meshGen {
43  public:
44  cfmeshGen();
45  explicit cfmeshGen(cfmeshParams *params);
46  ~cfmeshGen() override;
47 
48  // cfmesh mesh creation
49  public:
50  // create a 3D polygonal discretization from STL file
51  int createMeshFromSTL(const char *fname) override;
52 
53  // internal management
54  private:
55  // pre-processor
56  void initialize();
57 
58  // create dictionaries needed for openFoam
59  void createMshDict(const bool &write);
60 
61  // surface edge extraction
63 
64  // mesh quality improvement
65  int improveMeshQuality();
66 
67  // class data and management flags
68  private:
69  bool defaults;
70  std::string caseName{"_cfmesh"}; // internal information
72 
73  // openfoam data structure
74  private:
75  std::unique_ptr<Foam::dictionary> controlDict_;
76  std::unique_ptr<Foam::dictionary> fvSchemes_;
77  std::unique_ptr<Foam::dictionary> fvSolution_;
78  std::unique_ptr<Foam::Time> runTime_;
79  std::unique_ptr<Foam::fvMesh> fmesh_;
80  std::unique_ptr<Foam::dictionary> meshDict_;
81 };
82 
83 #endif
84 
85 #endif // NEMOSYS_CFMESHGEN_H_
std::unique_ptr< Foam::dictionary > meshDict_
Definition: cfmeshGen.H:80
std::unique_ptr< Foam::dictionary > fvSchemes_
Definition: cfmeshGen.H:76
int createMeshFromSTL(const char *fname) override
Definition: cfmeshGen.C:99
std::unique_ptr< Foam::fvMesh > fmesh_
Definition: cfmeshGen.H:79
void initialize()
Definition: cfmeshGen.C:71
~cfmeshGen() override
Definition: cfmeshGen.C:69
std::unique_ptr< Foam::dictionary > fvSolution_
Definition: cfmeshGen.H:77
std::string caseName
Definition: cfmeshGen.H:70
cfmeshGen()
Definition: cfmeshGen.C:55
bool defaults
Definition: cfmeshGen.H:69
cfmeshParams * params_
Definition: cfmeshGen.H:71
int improveMeshQuality()
Definition: cfmeshGen.C:194
void createMshDict(const bool &write)
Definition: cfmeshGen.C:241
int surfaceFeatureEdgeDetect()
Definition: cfmeshGen.C:156
std::unique_ptr< Foam::dictionary > controlDict_
Definition: cfmeshGen.H:75
std::unique_ptr< Foam::Time > runTime_
Definition: cfmeshGen.H:78