polyMeshFilterSettings.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2013 OpenFOAM Foundation
9  Copyright (C) 2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::polyMeshFilterSettings
29 
30 Description
31  Class to store the settings for the polyMeshFilter class.
32 
33 SourceFiles
34  polyMeshFilterSettings.C
35  polyMeshFilterSettingsI.H
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef polyMeshFilterSettings_H
40 #define polyMeshFilterSettings_H
41 
42 #include "dictionary.H"
43 #include "Switch.H"
44 #include "scalar.H"
45 #include "label.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 /*---------------------------------------------------------------------------*\
53  Class polyMeshFilterSettings Declaration
54 \*---------------------------------------------------------------------------*/
55 
57 {
58  // Private data
59 
60  //- Dictionary containing the coefficient sub-dictionaries
61  const dictionary dict_;
62 
63  //- After collapsing, check the mesh quality and redo the collapsing
64  // iteration if there are too many bad faces in the mesh
65  Switch controlMeshQuality_;
66 
67  //- Coefficients for collapsing edges
68  const dictionary& collapseEdgesCoeffDict_;
69 
70  //- Coefficients for collapsing faces
71  dictionary collapseFacesCoeffDict_;
72 
73  //- Coefficients for controlling the mesh quality
74  dictionary meshQualityCoeffDict_;
75 
76  //- Remove edges shorter than this length
77  const scalar minLen_;
78 
79  //- Merge points that are only attached to two edges and have an angle
80  // between the edge greater than this value
81  const scalar maxCos_;
82 
83  //- The amount that the local minimum edge length will be reduced by if
84  // the edge is part of a collapse string that generates poor quality
85  // faces
86  const scalar edgeReductionFactor_;
87 
88  //- Maximum number of outer iterations
89  const label maxIterations_;
90 
91  //- Maximum number of smoothing iterations of minEdgeLen_ and
92  // faceFilterFactor_
93  const label maxSmoothIters_;
94 
95  //- Initialisation value of faceFilterFactor_
96  const scalar initialFaceLengthFactor_;
97 
98  //- The amount that the local face size factor will be reduced by if
99  // the face is part of a collapse string that generates poor quality
100  // faces
101  const scalar faceReductionFactor_;
102 
103  //- Maximum number of times a deleted point can be associated with the
104  // creation of a bad face it is forced to be kept.
105  const label maxPointErrorCount_;
106 
107 
108 public:
109 
110  // Constructors
111 
112  //- Construct from dictionary
113  explicit polyMeshFilterSettings(const dictionary& dict);
114 
115 
116  //- Destructor
117  ~polyMeshFilterSettings() = default;
118 
119 
120  // Member Functions
121 
122  // Access
123 
124  inline const dictionary& collapseEdgesCoeffDict() const;
125 
126  inline const dictionary& collapseFacesCoeffDict() const;
127 
128  inline const dictionary& meshQualityCoeffDict() const;
129 
130  inline Switch controlMeshQuality() const;
131 
132  inline const scalar& minLen() const;
133 
134  inline const scalar& maxCos() const;
135 
136  inline const scalar& edgeReductionFactor() const;
137 
138  inline const label& maxIterations() const;
139 
140  inline const label& maxSmoothIters() const;
141 
142  inline const scalar& initialFaceLengthFactor() const;
143 
144  inline const scalar& faceReductionFactor() const;
145 
146  inline const label& maxPointErrorCount() const;
147 
148 
149  // Write
150 
151  //- Write the settings to a stream
152  void writeSettings(Ostream& os) const;
153 };
154 
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 } // End namespace Foam
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 #include "polyMeshFilterSettingsI.H"
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 #endif
167 
168 // ************************************************************************* //
polyMeshFilterSettingsI.H
Foam::Switch
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:77
Foam::polyMeshFilterSettings::writeSettings
void writeSettings(Ostream &os) const
Write the settings to a stream.
Definition: polyMeshFilterSettings.C:84
Foam::polyMeshFilterSettings::meshQualityCoeffDict
const dictionary & meshQualityCoeffDict() const
Definition: polyMeshFilterSettingsI.H:44
Foam::polyMeshFilterSettings::polyMeshFilterSettings
polyMeshFilterSettings(const dictionary &dict)
Construct from dictionary.
Definition: polyMeshFilterSettings.C:34
Foam::polyMeshFilterSettings::~polyMeshFilterSettings
~polyMeshFilterSettings()=default
Destructor.
Foam::polyMeshFilterSettings::collapseFacesCoeffDict
const dictionary & collapseFacesCoeffDict() const
Definition: polyMeshFilterSettingsI.H:38
Foam::polyMeshFilterSettings::controlMeshQuality
Switch controlMeshQuality() const
Definition: polyMeshFilterSettingsI.H:50
Foam::polyMeshFilterSettings::maxSmoothIters
const label & maxSmoothIters() const
Definition: polyMeshFilterSettingsI.H:76
Foam::polyMeshFilterSettings::initialFaceLengthFactor
const scalar & initialFaceLengthFactor() const
Definition: polyMeshFilterSettingsI.H:82
Foam::polyMeshFilterSettings::minLen
const scalar & minLen() const
Definition: polyMeshFilterSettingsI.H:55
Switch.H
Foam::polyMeshFilterSettings::collapseEdgesCoeffDict
const dictionary & collapseEdgesCoeffDict() const
Definition: polyMeshFilterSettingsI.H:32
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::polyMeshFilterSettings::faceReductionFactor
const scalar & faceReductionFactor() const
Definition: polyMeshFilterSettingsI.H:88
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
scalar.H
Foam::polyMeshFilterSettings::edgeReductionFactor
const scalar & edgeReductionFactor() const
Definition: polyMeshFilterSettingsI.H:66
Foam::polyMeshFilterSettings
Class to store the settings for the polyMeshFilter class.
Definition: polyMeshFilterSettings.H:55
os
OBJstream os(runTime.globalPath()/outputName)
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::polyMeshFilterSettings::maxPointErrorCount
const label & maxPointErrorCount() const
Definition: polyMeshFilterSettingsI.H:94
label.H
dictionary.H
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::polyMeshFilterSettings::maxCos
const scalar & maxCos() const
Definition: polyMeshFilterSettingsI.H:60
Foam::polyMeshFilterSettings::maxIterations
const label & maxIterations() const
Definition: polyMeshFilterSettingsI.H:71