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.
cfmeshParams.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_CFMESHPARAMS_H_
30 #define NEMOSYS_CFMESHPARAMS_H_
31 
32 #ifdef HAVE_CFMSH
33 
34 #include "nemosys_export.h"
36 
37 #include <string>
38 #include <vector>
39 #include <map>
40 #include <tuple>
41 #include <jsoncons/config/jsoncons_config.hpp> // for jsoncons::optional
42 
43 struct NEMOSYS_EXPORT cfmObjRef {
44  std::string name;
45  std::map<std::string, std::string> params; // all other parameters
46 };
47 
48 struct NEMOSYS_EXPORT cfmLclRefPatch {
49  std::string patchName; // patch name
50  double cellSize{-1.}; // patch cell size
51  int aditRefLvls{-1}; // additional refinement levels
52  double refThickness{-1.}; // local refinement thickness
53 };
54 
55 struct NEMOSYS_EXPORT cfmPtchBndLyr {
56  std::string patchName; // patch name
57  int blNLyr{-1}; // number of boundary layers
58  double blThkRto{1.}; // thickness ratio
59  double maxFrstLyrThk{-1.}; // thickness of first boundary layer
60  bool alwDiscont{false}; // allowing for discontinuity can be used for patches
61 };
62 
63 struct NEMOSYS_EXPORT cfmNewPatch {
64  std::string name;
65  std::string newName;
66  std::string newType;
67 };
68 
69 struct NEMOSYS_EXPORT cfmRenBndry {
70  std::string defName;
71  std::string defType;
72  std::vector<cfmNewPatch> newPatches;
73 };
74 
75 struct NEMOSYS_EXPORT cfmBoundaryLayer {
76  int blNLyr{1}; // number of boundary layers
77  double blThkRto{1.}; // thickness ratio
78  double maxFrstLyrThk{-1.}; // thickness of first boundary layer
79  // allowing for discontinuity can be used for patches
80  bool alwDiscont{false};
81  // define additional constrains on boundary layers
82  std::vector<cfmPtchBndLyr> blPatches{};
83 };
84 
85 struct NEMOSYS_EXPORT cfmMeshQual {
86  int qltNItr; // number of iterations
87  int qltNLop; // number of loops
88  double qltQltThr; // quality threshold
89  int qltNSrfItr; // number of surface iterations
90  std::string qltConCelSet{"none"}; // name of constrained cellSet
91 };
92 
93 struct NEMOSYS_EXPORT cfmSrfFeatEdge {
94  double srfEdgAng{45.};
95 };
96 
97 class NEMOSYS_EXPORT cfmeshParams : public meshingParams {
98  public:
99  // initializing params with defaults
100  cfmeshParams() = default;
101 
102  // general
103  bool alwDiscDomains{false}; // Multi-region meshing
104  std::string geomFilePath; // name of geometry file and full path
105  std::string generator; // mesh generation method to be used
106  double maxCellSize{-1.}; // maximum cell size
107  double minCellSize{-1.}; // minimum cell size
108  double bndryCellSize{-1.}; // boundary cell size
109  double bndryCellSizeRefThk{-1.}; // boundary cell size refinement thickness
110  bool keepCellIB{false}; // keep cells intersecting boundary
111  bool chkGluMsh{false}; // check for glued mesh
112 
113  // boundary layer
114  jsoncons::optional<cfmBoundaryLayer> boundaryLayers;
115 
116  // surfaceFeatureEdges
117  jsoncons::optional<cfmSrfFeatEdge> srfEdge{};
118 
119  // object refinements
120  std::vector<cfmObjRef> objRefLst; // objects to refine
121  std::string refTyp; // type of refinement size field
122  double refCellSize; // target cell size
123  std::string refP0; // P0 point coordinates eg (0,0,0)
124  std::string refP1; // P1 point coordinates eg (1,1,1)
125  double refRad0; // radius 0
126  double refRad1; // radius 1
127 
128  // mesh quality improvement
129  jsoncons::optional<cfmMeshQual> improveMeshQuality{};
130 
131  // local refinement
132  std::vector<cfmLclRefPatch> refPatches; // define additional constrains
133  // on refinement of given patches
134  // rename boundaries
135  jsoncons::optional<cfmRenBndry> renBndry; // rename boundaries
136 
137  // Boolean for if the operation is packmesh
138  bool isPackMesh{true};
139 };
140 
141 #endif
142 
143 #endif // NEMOSYS_CFMESHPARAMS_H_
std::string refTyp
Definition: cfmeshParams.H:121
jsoncons::optional< cfmBoundaryLayer > boundaryLayers
Definition: cfmeshParams.H:114
std::string defType
Definition: cfmeshParams.H:71
std::string newName
Definition: cfmeshParams.H:65
double qltQltThr
Definition: cfmeshParams.H:88
jsoncons::optional< cfmRenBndry > renBndry
Definition: cfmeshParams.H:135
std::string defName
Definition: cfmeshParams.H:70
std::string generator
Definition: cfmeshParams.H:105
std::string patchName
Definition: cfmeshParams.H:56
std::string refP0
Definition: cfmeshParams.H:123
std::string patchName
Definition: cfmeshParams.H:49
double refRad1
Definition: cfmeshParams.H:126
double refCellSize
Definition: cfmeshParams.H:122
std::vector< cfmLclRefPatch > refPatches
Definition: cfmeshParams.H:132
std::string geomFilePath
Definition: cfmeshParams.H:104
std::vector< cfmObjRef > objRefLst
Definition: cfmeshParams.H:120
std::string refP1
Definition: cfmeshParams.H:124
std::string name
Definition: cfmeshParams.H:44
std::vector< cfmNewPatch > newPatches
Definition: cfmeshParams.H:72
std::string newType
Definition: cfmeshParams.H:66
std::map< std::string, std::string > params
Definition: cfmeshParams.H:45
std::string name
Definition: cfmeshParams.H:64
double refRad0
Definition: cfmeshParams.H:125