triSurfaceMeshFeatures.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) 2013-2015 OpenFOAM Foundation
9  Copyright (C) 2018-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 "triSurfaceMeshFeatures.H"
31 #include "triSurfaceMesh.H"
32 #include "surfaceFeatures.H"
33 
34 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
35 
36 namespace Foam
37 {
38  defineTypeNameAndDebug(triSurfaceMeshFeatures, 0);
40  (
41  searchableSurfaceFeatures,
42  triSurfaceMeshFeatures,
43  dict
44  );
45 }
46 
47 
48 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
49 
50 Foam::triSurfaceMeshFeatures::triSurfaceMeshFeatures
51 (
52  const searchableSurface& surface,
53  const dictionary& dict
54 )
55 :
56  searchableSurfaceFeatures(surface, dict),
57  includedAngle_(dict.get<scalar>("includedAngle")),
58  mode_
59  (
60  extendedFeatureEdgeMesh::sideVolumeTypeNames_
61  [
62  dict.getOrDefault<word>("meshableSide", "inside")
63  ]
64  )
65 {
66  Info<< indent
67  << " Included angle = " << includedAngle_ << nl
68  << " Meshable region = "
70  << endl;
71 }
72 
73 
74 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
75 
78 {
79  const triSurfaceMesh& surfMesh = refCast<const triSurfaceMesh>(surface());
80 
81  surfaceFeatures sFeat(surfMesh, includedAngle_);
82 
83  // TODO: Need to read on a per region basis
84  boolList surfBaffleRegions
85  (
86  surfMesh.patches().size(),
87  (mode_ == extendedFeatureEdgeMesh::BOTH ? true : false)
88  );
89 
90 
92  (
93  sFeat,
94  surface().db(),
95  surface().name() + ".extendedFeatureEdgeMesh",
96  surfBaffleRegions
97  );
98 }
99 
100 
101 // ************************************************************************* //
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
dictionary dict
static const Enum< sideVolumeType > sideVolumeTypeNames_
Ostream & indent(Ostream &os)
Indent stream.
Definition: Ostream.H:449
constexpr char nl
The newline &#39;\n&#39; character (0x0a)
Definition: Ostream.H:49
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:487
Macros for easy insertion into run-time selection tables.
virtual autoPtr< extendedFeatureEdgeMesh > features() const
Return an extendedFeatureEdgeMesh containing the features.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:52
const wordList surface
Standard surface field types (scalar, vector, tensor, etc)
defineTypeNameAndDebug(combustionModel, 0)
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
messageStream Info
Information stream (stdout output on master, null elsewhere)
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
static autoPtr< T > New(Args &&... args)
Construct autoPtr with forwarding arguments.
Definition: autoPtr.H:178
List< bool > boolList
A List of bools.
Definition: List.H:60
Namespace for OpenFOAM.