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-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::polyMeshFilterSettings
29
30Description
31 Class to store the settings for the polyMeshFilter class.
32
33SourceFiles
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
49namespace Foam
50{
51
52/*---------------------------------------------------------------------------*\
53 Class polyMeshFilterSettings Declaration
54\*---------------------------------------------------------------------------*/
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
108public:
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
163
164// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165
166#endif
167
168// ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:78
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Class to store the settings for the polyMeshFilter class.
const label & maxPointErrorCount() const
void writeSettings(Ostream &os) const
Write the settings to a stream.
const label & maxSmoothIters() const
const scalar & initialFaceLengthFactor() const
const scalar & faceReductionFactor() const
const scalar & edgeReductionFactor() const
const dictionary & collapseEdgesCoeffDict() const
~polyMeshFilterSettings()=default
Destructor.
const dictionary & collapseFacesCoeffDict() const
const dictionary & meshQualityCoeffDict() const
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
dictionary dict