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
63 
64  //- Coefficients for collapsing edges
66 
67  //- Coefficients for collapsing faces
69 
70  //- Coefficients for controlling the mesh quality
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.
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 // ************************************************************************* //
polyMeshFilterSettingsI.H
Foam::polyMeshFilterSettings::maxSmoothIters_
const label maxSmoothIters_
Maximum number of smoothing iterations of minEdgeLen_ and.
Definition: polyMeshFilterSettings.H:89
Foam::Switch
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:60
Foam::polyMeshFilterSettings::controlMeshQuality
const Switch & controlMeshQuality() const
Definition: polyMeshFilterSettingsI.H:48
Foam::polyMeshFilterSettings::writeSettings
void writeSettings(Ostream &os) const
Write the settings to a stream.
Definition: polyMeshFilterSettings.C:93
Foam::polyMeshFilterSettings::meshQualityCoeffDict
const dictionary & meshQualityCoeffDict() const
Definition: polyMeshFilterSettingsI.H:41
Foam::polyMeshFilterSettings::initialFaceLengthFactor_
const scalar initialFaceLengthFactor_
Initialisation value of faceFilterFactor_.
Definition: polyMeshFilterSettings.H:92
Foam::polyMeshFilterSettings::~polyMeshFilterSettings
~polyMeshFilterSettings()
Destructor.
Definition: polyMeshFilterSettings.H:113
Foam::polyMeshFilterSettings::polyMeshFilterSettings
polyMeshFilterSettings(const dictionary &dict)
Construct from dictionary.
Definition: polyMeshFilterSettings.C:31
Foam::polyMeshFilterSettings::minLen_
const scalar minLen_
Remove edges shorter than this length.
Definition: polyMeshFilterSettings.H:73
Foam::polyMeshFilterSettings::collapseEdgesCoeffDict_
const dictionary & collapseEdgesCoeffDict_
Coefficients for collapsing edges.
Definition: polyMeshFilterSettings.H:64
Foam::polyMeshFilterSettings::dict_
const dictionary dict_
Dictionary containing the coefficient sub-dictionaries.
Definition: polyMeshFilterSettings.H:57
Foam::polyMeshFilterSettings::collapseFacesCoeffDict
const dictionary & collapseFacesCoeffDict() const
Definition: polyMeshFilterSettingsI.H:35
Foam::polyMeshFilterSettings::maxSmoothIters
const label & maxSmoothIters() const
Definition: polyMeshFilterSettingsI.H:74
Foam::polyMeshFilterSettings::initialFaceLengthFactor
const scalar & initialFaceLengthFactor() const
Definition: polyMeshFilterSettingsI.H:80
Foam::polyMeshFilterSettings::maxCos_
const scalar maxCos_
Merge points that are only attached to two edges and have an angle.
Definition: polyMeshFilterSettings.H:77
Foam::label
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
Foam::polyMeshFilterSettings::edgeReductionFactor_
const scalar edgeReductionFactor_
The amount that the local minimum edge length will be reduced by if.
Definition: polyMeshFilterSettings.H:82
Foam::polyMeshFilterSettings::minLen
const scalar & minLen() const
Definition: polyMeshFilterSettingsI.H:53
Switch.H
Foam::polyMeshFilterSettings::collapseEdgesCoeffDict
const dictionary & collapseEdgesCoeffDict() const
Definition: polyMeshFilterSettingsI.H:29
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::polyMeshFilterSettings::faceReductionFactor
const scalar & faceReductionFactor() const
Definition: polyMeshFilterSettingsI.H:86
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
scalar.H
Foam::polyMeshFilterSettings::edgeReductionFactor
const scalar & edgeReductionFactor() const
Definition: polyMeshFilterSettingsI.H:64
Foam::polyMeshFilterSettings
Class to store the settings for the polyMeshFilter class.
Definition: polyMeshFilterSettings.H:52
Foam::polyMeshFilterSettings::faceReductionFactor_
const scalar faceReductionFactor_
The amount that the local face size factor will be reduced by if.
Definition: polyMeshFilterSettings.H:97
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::polyMeshFilterSettings::maxPointErrorCount
const label & maxPointErrorCount() const
Definition: polyMeshFilterSettingsI.H:92
Foam::polyMeshFilterSettings::meshQualityCoeffDict_
dictionary meshQualityCoeffDict_
Coefficients for controlling the mesh quality.
Definition: polyMeshFilterSettings.H:70
Foam::polyMeshFilterSettings::maxPointErrorCount_
const label maxPointErrorCount_
Maximum number of times a deleted point can be associated with the.
Definition: polyMeshFilterSettings.H:101
label.H
dictionary.H
Foam::polyMeshFilterSettings::maxIterations_
const label maxIterations_
Maximum number of outer iterations.
Definition: polyMeshFilterSettings.H:85
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::polyMeshFilterSettings::maxCos
const scalar & maxCos() const
Definition: polyMeshFilterSettingsI.H:58
Foam::polyMeshFilterSettings::maxIterations
const label & maxIterations() const
Definition: polyMeshFilterSettingsI.H:69
Foam::polyMeshFilterSettings::collapseFacesCoeffDict_
dictionary collapseFacesCoeffDict_
Coefficients for collapsing faces.
Definition: polyMeshFilterSettings.H:67
Foam::polyMeshFilterSettings::controlMeshQuality_
Switch controlMeshQuality_
After collapsing, check the mesh quality and redo the collapsing.
Definition: polyMeshFilterSettings.H:61