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 // ************************************************************************* //
Foam::addToRunTimeSelectionTable
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
Foam::autoPtr::New
static autoPtr< T > New(Args &&... args)
Construct autoPtr of T with forwarding arguments.
surfaceFeatures.H
Foam::boolList
List< bool > boolList
A List of bools.
Definition: List.H:65
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:369
Foam::extendedEdgeMesh::sideVolumeTypeNames_
static const Enum< sideVolumeType > sideVolumeTypeNames_
Definition: extendedEdgeMesh.H:125
Foam::Info
messageStream Info
Information stream (stdout output on master, null elsewhere)
dict
dictionary dict
Definition: searchingEngine.H:14
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
triSurfaceMeshFeatures.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::indent
Ostream & indent(Ostream &os)
Indent stream.
Definition: Ostream.H:339
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::nl
constexpr char nl
Definition: Ostream.H:404
Foam::extendedEdgeMesh::BOTH
e.g. a baffle
Definition: extendedEdgeMesh.H:121
Foam::PtrListOps::get
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
Foam::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
Foam::triSurfaceMeshFeatures::features
virtual autoPtr< extendedFeatureEdgeMesh > features() const
Return an extendedFeatureEdgeMesh containing the features.
triSurfaceMesh.H
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)