MPLICface.H
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) 2020-2021 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 Class
25  Foam::MPLICface
26 
27 Description
28  Class that deals with cutting faces based on face point values and target
29  value.
30 
31 SourceFiles
32  MPLICface.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef MPLICface_H
37 #define MPLICface_H
38 
39 #include "face.H"
40 #include "pointField.H"
41 #include "DynamicList.H"
42 #include "boolList.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class MPLICface Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class MPLICface
54 {
55  // Private Member variables
56 
57  //- Store all the cut points
58  DynamicList<point> cutPoints_;
59 
60  //- Store points of sub face
61  DynamicList<point> subPoints_;
62 
63  //- Labels of cut edges
64  DynamicList<label> cutEdges_;
65 
66  //- Store velocity point values
67  DynamicList<vector> subPointsU_;
68 
69  //- Keep truck of face orientation
70  bool flipped_;
71 
72  //- Select unweighted interpolation if true
73  // velocity flux corrected if false
74  const bool unweighted_;
75 
76 
77  public:
78 
79  // Constructors
80 
81  //- Construct empty
82  MPLICface(const bool unweighted = true);
83 
84  // - Destructor
85  ~MPLICface()
86  {}
87 
88 
89  // Member functions
90 
91  //- Function to cut for multi cut
92  // Returns:
93  // - 0: no cut
94  // - 1: cut
96  (
97  const labelList& f,
98  const labelList& faceEdges,
99  const pointField& points,
100  const boolList& isEdgeCutOld,
101  boolList& isEdgeCut,
102  label& faceEdgei,
103  const UList<scalar>& pointsAlpha,
104  const UList<vector>& pointsU,
105  const label facei,
106  const scalar target,
107  const bool ow
108  );
109 
110  //- Cut the face and return the type of cut
111  // Returns:
112  // - -1: multi cut
113  // - 0: no cut
114  // - +1: single cut
115  label cutFace
116  (
117  const UList<label>& f,
118  const UList<point>& points,
119  const UList<scalar>& pointsAlpha,
120  const UList<vector>& pointsU,
121  const scalar target,
122  const bool ow
123  );
124 
125  //- Calculate and return alphaPhiU
126  inline scalar alphaPhiU() const;
127 
128  //- Calculate and return alphaPhiU
129  template<class VectorList, class PointList>
130  inline scalar alphaPhiU
131  (
132  const VectorList& pointsU,
133  const PointList& points
134  ) const;
135 
136  //- Calculate and return alphaPhiU
137  template<class VectorList, class PointList>
138  inline scalar alphaPhiU
139  (
140  const VectorList& pointsU,
141  const PointList& points,
142  const labelList& f
143  ) const;
144 
145  //- Access to cut points
146  inline const DynamicList<point>& cutPoints() const;
147 
148  //- Access to submerged face points
149  inline const DynamicList<point>& subPoints() const;
150 
151  //- Access to cut edges
152  inline const DynamicList<label>& cutEdges() const;
153 
154  //- Return subface surface area vector
155  inline const vector Sf() const;
156 
157  //- Return subface centre
158  inline const vector Cf(const vector& area) const;
159 
160  //- Return interpolated U values
161  inline const DynamicList<vector>& U() const;
162 };
163 
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 } // End namespace Foam
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 #include "MPLICfaceI.H"
172 
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 
175 #endif
176 
177 // ************************************************************************* //
const vector Sf() const
Return subface surface area vector.
Definition: MPLICfaceI.H:115
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
const vector Cf(const vector &area) const
Return subface centre.
Definition: MPLICfaceI.H:122
const DynamicList< point > & cutPoints() const
Access to cut points.
Definition: MPLICfaceI.H:96
const DynamicList< label > & cutEdges() const
Access to cut edges.
Definition: MPLICfaceI.H:109
Class that deals with cutting faces based on face point values and target value.
Definition: MPLICface.H:52
MPLICface(const bool unweighted=true)
Construct empty.
Definition: MPLICface.C:31
const pointField & points
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
Definition: DynamicList.H:56
labelList f(nPoints)
const DynamicList< vector > & U() const
Return interpolated U values.
label cutFace(const labelList &f, const labelList &faceEdges, const pointField &points, const boolList &isEdgeCutOld, boolList &isEdgeCut, label &faceEdgei, const UList< scalar > &pointsAlpha, const UList< vector > &pointsU, const label facei, const scalar target, const bool ow)
Function to cut for multi cut.
Definition: MPLICface.C:40
const DynamicList< point > & subPoints() const
Access to submerged face points.
Definition: MPLICfaceI.H:103
scalar alphaPhiU() const
Calculate and return alphaPhiU.
Definition: MPLICfaceI.H:30
Namespace for OpenFOAM.