Loading...
Searching...
No Matches
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-------------------------------------------------------------------------------
11License
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
31#include "triSurfaceMesh.H"
32#include "surfaceFeatures.H"
33
34// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
35
36namespace Foam
37{
40 (
43 dict
44 );
45}
46
47
48// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
49
50Foam::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 = "
69 << extendedFeatureEdgeMesh::sideVolumeTypeNames_[mode_]
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// ************************************************************************* //
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
static autoPtr< T > New(Args &&... args)
Construct autoPtr with forwarding arguments.
Definition autoPtr.H:178
Decorator that returns the features of a searchable surface.
const searchableSurface & surface() const
Return a reference to the searchable surface.
virtual autoPtr< extendedFeatureEdgeMesh > features() const
Return an extendedFeatureEdgeMesh containing the features.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition className.H:142
auto & name
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
const wordList surface
Standard surface field types (scalar, vector, tensor, etc).
Namespace for OpenFOAM.
Type & refCast(U &obj)
A dynamic_cast (for references) to Type reference.
Definition typeInfo.H:172
messageStream Info
Information stream (stdout output on master, null elsewhere).
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition Ostream.H:519
Ostream & indent(Ostream &os)
Indent stream.
Definition Ostream.H:481
List< bool > boolList
A List of bools.
Definition List.H:60
constexpr char nl
The newline '\n' character (0x0a).
Definition Ostream.H:50
dictionary dict