meshedSurf.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) 2016-2020 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::meshedSurf
28 
29 Description
30  Abstract definition of a meshed surface defined by faces and points.
31 
32 \*---------------------------------------------------------------------------*/
33 
34 #ifndef meshedSurf_H
35 #define meshedSurf_H
36 
37 #include "pointField.H"
38 #include "faceList.H"
39 #include "labelList.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class meshedSurf Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 class meshedSurf
51 {
52 public:
53 
54  // Forward declarations
55  class emptySurface;
56 
57 
58  // Constructors
59 
60  //- Default construct
61  constexpr meshedSurf() noexcept = default;
62 
63 
64  //- Destructor
65  virtual ~meshedSurf() = default;
66 
67 
68  // Member Functions
69 
70  //- The points used for the surface
71  virtual const pointField& points() const = 0;
72 
73  //- The faces used for the surface
74  virtual const faceList& faces() const = 0;
75 
76  //- Per-face zone/region information.
77  // Default is zero-sizes (ie, no zone information)
78  virtual const labelList& zoneIds() const
79  {
80  return labelList::null();
81  }
82 
83  //- Per-face identifier (eg, element Id)
84  virtual const labelList& faceIds() const
85  {
86  return labelList::null();
87  }
88 };
89 
90 
91 /*---------------------------------------------------------------------------*\
92  Class meshedSurf::emptySurface Declaration
93 \*---------------------------------------------------------------------------*/
94 
95 //- A concrete meshedSurf class without faces, points, etc.
97 :
98  public meshedSurf
99 {
100 public:
101 
102  // Constructors
103 
104  //- Default construct
105  constexpr emptySurface() noexcept = default;
106 
107 
108  //- Destructor
109  virtual ~emptySurface() = default;
110 
111 
112  // Member Functions
113 
114  //- Zero-sized point field
115  virtual const pointField& points() const
116  {
117  return pointField::null();
118  }
119 
120  //- Zero-sized face list
121  virtual const faceList& faces() const
122  {
123  return faceList::null();
124  }
125 };
126 
127 
128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 
130 } // End namespace Foam
131 
132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133 
134 #endif
135 
136 // ************************************************************************* //
Foam::meshedSurf::emptySurface::~emptySurface
virtual ~emptySurface()=default
Destructor.
Foam::List::null
static const List< T > & null()
Return a null List.
Definition: ListI.H:109
Foam::meshedSurf::faces
virtual const faceList & faces() const =0
The faces used for the surface.
Foam::meshedSurf
Abstract definition of a meshed surface defined by faces and points.
Definition: meshedSurf.H:49
Foam::meshedSurf::emptySurface::points
virtual const pointField & points() const
Zero-sized point field.
Definition: meshedSurf.H:114
faceList.H
Foam::meshedSurf::meshedSurf
constexpr meshedSurf() noexcept=default
Default construct.
labelList.H
Foam::Field< vector >
Foam::meshedSurf::~meshedSurf
virtual ~meshedSurf()=default
Destructor.
Foam::meshedSurf::points
virtual const pointField & points() const =0
The points used for the surface.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::meshedSurf::emptySurface::emptySurface
constexpr emptySurface() noexcept=default
Default construct.
Foam::meshedSurf::emptySurface::faces
virtual const faceList & faces() const
Zero-sized face list.
Definition: meshedSurf.H:120
Foam::meshedSurf::emptySurface
A concrete meshedSurf class without faces, points, etc.
Definition: meshedSurf.H:95
pointField.H
Foam::meshedSurf::faceIds
virtual const labelList & faceIds() const
Per-face identifier (eg, element Id)
Definition: meshedSurf.H:83
Foam::List< face >
Foam::meshedSurf::zoneIds
virtual const labelList & zoneIds() const
Per-face zone/region information.
Definition: meshedSurf.H:77
Foam::Field::null
static const Field< Type > & null()
Return nullObject reference Field.
Definition: FieldI.H:31