snapParameters.C
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) 2011-2015 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 \*---------------------------------------------------------------------------*/
28 
29 #include "snapParameters.H"
30 #include "meshRefinement.H"
31 
32 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
33 
34 // Construct from dictionary
35 Foam::snapParameters::snapParameters(const dictionary& dict, const bool dryRun)
36 :
37  nSmoothPatch_
38  (
39  meshRefinement::get<label>(dict, "nSmoothPatch", dryRun)
40  ),
41  nSmoothInternal_(dict.getOrDefault<label>("nSmoothInternal", 0)),
42  snapTol_
43  (
44  meshRefinement::get<scalar>(dict, "tolerance", dryRun)
45  ),
46  nSmoothDispl_
47  (
48  meshRefinement::get<label>(dict, "nSolveIter", dryRun)
49  ),
50  nSnap_
51  (
52  meshRefinement::get<label>(dict, "nRelaxIter", dryRun)
53  ),
54  nFeatureSnap_(dict.getOrDefault("nFeatureSnapIter", -1)),
55  explicitFeatureSnap_(dict.getOrDefault("explicitFeatureSnap", true)),
56  implicitFeatureSnap_(dict.getOrDefault("implicitFeatureSnap", false)),
57  multiRegionFeatureSnap_
58  (
59  dict.getOrDefault("multiRegionFeatureSnap", false)
60  ),
61  detectNearSurfacesSnap_
62  (
63  dict.getOrDefault("detectNearSurfacesSnap", true)
64  ),
65  strictRegionSnap_
66  (
67  dict.getOrDefault("strictRegionSnap", false)
68  ),
69  detectBaffles_(dict.getOrDefault("detectBaffles", true)),
70  baffleFeaturePoints_(dict.getOrDefault("baffleFeaturePoints", false)),
71  releasePoints_(dict.getOrDefault("releasePoints", false)),
72  stringFeatures_(dict.getOrDefault("stringFeatures", true)),
73  avoidDiagonal_(dict.getOrDefault("avoidDiagonal", false)),
74  nFaceSplitInterval_
75  (
76  dict.getOrDefault("nFaceSplitInterval", labelMin)
77  ),
78  concaveAngle_(dict.getOrDefault<scalar>("concaveAngle", 45)),
79  minAreaRatio_(dict.getOrDefault<scalar>("minAreaRatio", 0.3)),
80  dryRun_(dryRun)
81 {}
82 
83 
84 // ************************************************************************* //
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
meshRefinement.H
Foam::meshRefinement
Helper class which maintains intersections of (changing) mesh with (static) surfaces.
Definition: meshRefinement.H:85
snapParameters.H
Foam::labelMin
constexpr label labelMin
Definition: label.H:60
Foam::PtrListOps::get
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)