cutFacePLIC.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-2017 DHI
9 Copyright (C) 2018-2019 Johan Roenby
10 Copyright (C) 2019-2020 DLR
11-------------------------------------------------------------------------------
12License
13 This file is part of OpenFOAM.
14
15 OpenFOAM is free software: you can redistribute it and/or modify it
16 under the terms of the GNU General Public License as published by
17 the Free Software Foundation, either version 3 of the License, or
18 (at your option) any later version.
19
20 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
21 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
22 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23 for more details.
24
25 You should have received a copy of the GNU General Public License
26 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
27
28Class
29 Foam::cutFacePLIC
30
31Description
32 Class for cutting a face, faceI, of an fvMesh, mesh_, at its intersection
33 with an plane defined by normal and a base point
34
35 Reference:
36 \verbatim
37
38 Henning Scheufler, Johan Roenby,
39 Accurate and efficient surface reconstruction from volume
40 fraction data on general meshes,
41 Journal of Computational Physics, 2019,
42 doi 10.1016/j.jcp.2019.01.009
43
44 \endverbatim
45
46
47 Original code supplied by Henning Scheufler, DLR (2019)
48
49SourceFiles
50 cutFacePLIC.C
51
52\*---------------------------------------------------------------------------*/
53
54#ifndef cutFacePLIC_H
55#define cutFacePLIC_H
56
57#include "fvMesh.H"
58#include "volFields.H"
59#include "surfaceFields.H"
60#include "cutFace.H"
61
62// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
63
64namespace Foam
65{
66
67/*---------------------------------------------------------------------------*\
68 Class cutFacePLIC Declaration
69\*---------------------------------------------------------------------------*/
71class cutFacePLIC
72:
73 public cutFace
74{
75 // Private Data
76
77 //- Mesh whose cells and faces to cut at their intersection
78 //- with an isoface
79 const fvMesh& mesh_;
80
81 //- Storage for centre of subface
82 point subFaceCentre_;
83
84 //- Storage for area vector of subface
85 vector subFaceArea_;
86
87 //- Storage for subFacePoints
88 DynamicList<point> subFacePoints_;
89
90 //- Storage for subFacePoints
91 DynamicList<point> surfacePoints_;
92
93 //- Storage for pointStatus_ cuts the cell at 0
94 DynamicList<scalar> pointStatus_;
95
96 //- Storage of the edge weight
97 DynamicList<scalar> weight_;
98
99 //- A face status label taking one of the values:
100 //
101 // -1: face is fully below the PLICsurface
102 // 0: face is cut (has values larger and smaller than cutValue_)
103 // +1: face is fully above the PLICsurface
104 label faceStatus_;
105
106
107public:
108
109 // Constructors
110
111 //- Construct from fvMesh and a scalarField
112 explicit cutFacePLIC(const fvMesh& mesh);
113
114
115 // Member Functions
116
117 //- Calculate cut points along edges of faceI
118 label calcSubFace
119 (
120 const label faceI,
121 const vector& normal,
122 const vector& base
123 );
124
125 //- Returns centre of cutted face
126 const point& subFaceCentre() const noexcept
127 {
128 return subFaceCentre_;
129 }
130
131 //- Returns area vector of cutted face
132 const vector& subFaceArea() const noexcept
133 {
134 return subFaceArea_;
135 }
136
137 //- Returns the cut edge of the cutted face
139 {
140 return subFacePoints_;
141 }
142
143 //- Returns point of the face in sorted of cutted face
145 {
146 return surfacePoints_;
147 }
148
149 //- Resets internal variables
150 void clearStorage();
151};
152
153
154// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155
156} // End namespace Foam
157
158// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159
160#endif
161
162// ************************************************************************* //
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Definition: DynamicList.H:72
Class for cutting a face, faceI, of an fvMesh, mesh_, at its intersection with an plane defined by no...
Definition: cutFacePLIC.H:73
label calcSubFace(const label faceI, const vector &normal, const vector &base)
Calculate cut points along edges of faceI.
Definition: cutFacePLIC.C:53
const vector & subFaceArea() const noexcept
Returns area vector of cutted face.
Definition: cutFacePLIC.H:131
void clearStorage()
Resets internal variables.
Definition: cutFacePLIC.C:118
const DynamicList< point > & surfacePoints() const noexcept
Returns point of the face in sorted of cutted face.
Definition: cutFacePLIC.H:143
const DynamicList< point > & subFacePoints() const noexcept
Returns the cut edge of the cutted face.
Definition: cutFacePLIC.H:137
const point & subFaceCentre() const noexcept
Returns centre of cutted face.
Definition: cutFacePLIC.H:125
Base class for cutting a face, faceI, of an fvMesh, mesh_, at its intersections.
Definition: cutFace.H:60
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
dynamicFvMesh & mesh
Namespace for OpenFOAM.
const direction noexcept
Definition: Scalar.H:223
Foam::surfaceFields.