isoSurfaceBase.H
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) 2019 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::isoSurfaceBase
28 
29 Description
30  Low-level components common to various iso-surface algorithms.
31 
32 SourceFiles
33  isoSurfaceBase.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef isoSurfaceBase_H
38 #define isoSurfaceBase_H
39 
40 #include "scalar.H"
41 #include "Enum.H"
42 #include "boundBox.H"
43 #include "MeshedSurface.H"
44 #include "MeshedSurfacesFwd.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 /*---------------------------------------------------------------------------*\
52  Class isoSurfaceBase Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 class isoSurfaceBase
56 :
57  public meshedSurface
58 {
59 protected:
60 
61  // Protected typedefs for convenience
62  typedef meshedSurface MeshStorage;
63 
64  // Protected Data
65 
66  //- Iso value
67  const scalar iso_;
68 
69  //- Optional bounds
70  const boundBox bounds_;
71 
72  //- For every face, the original cell in mesh
74 
75 
76 public:
77 
78  //- The algorithm types
79  enum algorithmType : uint8_t
80  {
83  ALGO_TOPO
84  };
85 
86 
87  //- The filtering (regularization) to apply
88  enum class filterType : uint8_t
89  {
90  NONE = 0,
91  CELL,
92  DIAGCELL,
93  PARTIAL = CELL,
94  FULL = DIAGCELL,
95  };
96 
97 
98  // Public Data
99 
100  //- Names for the iso-surface algorithms
101  static const Enum<algorithmType> algorithmNames;
102 
103  //- Names for the filtering types
104  static const Enum<filterType> filterNames;
105 
106 
107 
108  // Static Member Functions
109 
110  //- Get 'regularise' as bool or enumeration
112  (
113  const dictionary& dict,
114  const isoSurfaceBase::filterType deflt
115  );
116 
117 
118  // Constructors
119 
120  //- Construct with iso value
121  explicit isoSurfaceBase
122  (
123  const scalar iso,
124  const boundBox& bounds = boundBox::invertedBox
125  );
126 
127 
128  // Member Functions
129 
130  //- The iso-value associated with the surface
131  inline scalar isoValue() const
132  {
133  return iso_;
134  }
135 
136  //- For each face, the original cell in mesh
137  const labelList& meshCells() const
138  {
139  return meshCells_;
140  }
141 
142  //- For each face, the original cell in mesh
144  {
145  return meshCells_;
146  }
147 };
148 
149 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
152 } // End namespace Foam
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 #endif
157 
158 // ************************************************************************* //
Foam::isoSurfaceBase::filterType::NONE
No filtering.
Foam::Enum< algorithmType >
Foam::isoSurfaceBase::filterType::DIAGCELL
Remove points from pyramid edges and face-diagonals.
Foam::isoSurfaceBase
Low-level components common to various iso-surface algorithms.
Definition: isoSurfaceBase.H:54
Foam::isoSurfaceBase::meshCells
labelList & meshCells()
For each face, the original cell in mesh.
Definition: isoSurfaceBase.H:142
Foam::boundBox::invertedBox
static const boundBox invertedBox
A large inverted boundBox: min/max == +/- ROOTVGREAT.
Definition: boundBox.H:86
Foam::isoSurfaceBase::ALGO_CELL
Definition: isoSurfaceBase.H:81
Foam::isoSurfaceBase::ALGO_POINT
Definition: isoSurfaceBase.H:80
Foam::isoSurfaceBase::algorithmNames
static const Enum< algorithmType > algorithmNames
Names for the iso-surface algorithms.
Definition: isoSurfaceBase.H:100
Foam::isoSurfaceBase::MeshStorage
meshedSurface MeshStorage
Definition: isoSurfaceBase.H:61
Foam::isoSurfaceBase::filterNames
static const Enum< filterType > filterNames
Names for the filtering types.
Definition: isoSurfaceBase.H:103
Foam::isoSurfaceBase::isoValue
scalar isoValue() const
The iso-value associated with the surface.
Definition: isoSurfaceBase.H:130
Foam::isoSurfaceBase::algorithmType
algorithmType
The algorithm types.
Definition: isoSurfaceBase.H:78
Foam::isoSurfaceBase::meshCells_
labelList meshCells_
For every face, the original cell in mesh.
Definition: isoSurfaceBase.H:72
Foam::isoSurfaceBase::bounds_
const boundBox bounds_
Optional bounds.
Definition: isoSurfaceBase.H:69
Foam::isoSurfaceBase::iso_
const scalar iso_
Iso value.
Definition: isoSurfaceBase.H:66
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::isoSurfaceBase::isoSurfaceBase
isoSurfaceBase(const scalar iso, const boundBox &bounds=boundBox::invertedBox)
Construct with iso value.
Definition: isoSurfaceBase.C:103
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
scalar.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::isoSurfaceBase::filterType::FULL
Same as DIAGCELL.
boundBox.H
Foam::isoSurfaceBase::filterType::PARTIAL
Same as CELL.
Foam::isoSurfaceBase::filterType::CELL
Remove points from pyramid edges.
Foam::List< label >
Foam::isoSurfaceBase::getFilterType
static filterType getFilterType(const dictionary &dict, const isoSurfaceBase::filterType deflt)
Get 'regularise' as bool or enumeration.
Definition: isoSurfaceBase.C:62
Foam::boundBox
A bounding box defined in terms of min/max extrema points.
Definition: boundBox.H:63
MeshedSurfacesFwd.H
Foam::isoSurfaceBase::meshCells
const labelList & meshCells() const
For each face, the original cell in mesh.
Definition: isoSurfaceBase.H:136
Foam::MeshedSurface< face >
Foam::isoSurfaceBase::ALGO_TOPO
Definition: isoSurfaceBase.H:82
Foam::isoSurfaceBase::filterType
filterType
The filtering (regularization) to apply.
Definition: isoSurfaceBase.H:87
MeshedSurface.H
Enum.H