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