triSurfaceMeshFeatures.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2013-2018 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 \*---------------------------------------------------------------------------*/
25 
26 #include "triSurfaceMeshFeatures.H"
28 #include "triSurfaceMesh.H"
29 #include "surfaceFeatures.H"
30 
31 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32 
33 namespace Foam
34 {
35 
36 defineTypeNameAndDebug(triSurfaceMeshFeatures, 0);
38 (
39  searchableSurfaceFeatures,
40  triSurfaceMeshFeatures,
41  dict
42 );
43 
44 }
45 
46 
47 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
48 
49 
50 
51 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
52 
54 (
55  const searchableSurface& surface,
56  const dictionary& dict
57 )
58 :
59  searchableSurfaceFeatures(surface, dict),
60  includedAngle_(readScalar(dict.lookup("includedAngle"))),
61  mode_
62  (
63  extendedFeatureEdgeMesh::sideVolumeTypeNames_
64  [
65  dict.lookupOrDefault<word>("meshableSide", "inside")
66  ]
67  )
68 {
69  Info<< indent
70  << " Included angle = " << includedAngle_ << nl
71  << " Meshable region = "
73  << endl;
74 }
75 
76 
77 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
78 
80 {}
81 
82 
83 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
84 
87 {
88  autoPtr<extendedFeatureEdgeMesh> features;
89 
90  const triSurfaceMesh& surfMesh = refCast<const triSurfaceMesh>(surface());
91 
92  surfaceFeatures sFeat(surfMesh, includedAngle_);
93 
94  // TODO: Need to read on a per region basis
95  boolList surfBaffleRegions
96  (
97  surfMesh.patches().size(),
98  (mode_ == extendedFeatureEdgeMesh::BOTH ? true : false)
99  );
100 
101  features.set
102  (
103  new extendedFeatureEdgeMesh
104  (
105  sFeat,
106  surface().db(),
107  surface().name() + ".extendedFeatureEdgeMesh",
108  surfBaffleRegions
109  )
110  );
111 
112  return features;
113 }
114 
115 
116 // ************************************************************************* //
dictionary dict
const searchableSurface & surface() const
Return a reference to the searchable surface.
triSurfaceMeshFeatures(const searchableSurface &surface, const dictionary &dict)
Construct from dictionary (used by searchableSurface)
Ostream & indent(Ostream &os)
Indent stream.
Definition: Ostream.H:226
virtual ~triSurfaceMeshFeatures()
Destructor.
static const Foam::NamedEnum< sideVolumeType, 4 > sideVolumeTypeNames_
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:256
Macros for easy insertion into run-time selection tables.
virtual autoPtr< extendedFeatureEdgeMesh > features() const
Return an extendedFeatureEdgeMesh containing the features.
List< bool > boolList
Bool container classes.
Definition: boolList.H:50
virtual autoPtr< extendedFeatureEdgeMesh > features() const
Return an extendedFeatureEdgeMesh containing the features.
stressControl lookup("compactNormalStress") >> compactNormalStress
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if successful.
Definition: doubleScalar.H:68
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
static const char nl
Definition: Ostream.H:265
defineTypeNameAndDebug(combustionModel, 0)
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
messageStream Info
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
Namespace for OpenFOAM.