interpolationCellPointFace.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) 2011-2022 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::interpolationCellPointFace
26 
27 Description
28  Foam::interpolationCellPointFace
29 
30 \*---------------------------------------------------------------------------*/
31 
32 #ifndef interpolationCellPointFace_H
33 #define interpolationCellPointFace_H
34 
36 
37 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
38 
39 namespace Foam
40 {
41 
42 /*---------------------------------------------------------------------------*\
43  Class interpolationCellPointFace Declaration
44 \*---------------------------------------------------------------------------*/
45 
46 template<class Type>
48 :
49  public fieldInterpolation<Type, interpolationCellPointFace<Type>>,
51 {
52  // Private Data
53 
54  //- Linearly interpolated volfield
55  const SurfaceField<Type> psis_;
56 
57  bool findTet
58  (
59  const vector& position,
60  const label nFace,
61  vector tetPoints[],
62  label tetLabelCandidate[],
63  label tetPointLabels[],
64  scalar phi[],
65  scalar phiCandidate[],
66  label& closestFace,
67  scalar& minDistance
68  ) const;
69 
70  bool findTriangle
71  (
72  const vector& position,
73  const label nFace,
74  label tetPointLabels[],
75  scalar phi[]
76  ) const;
77 
78 
79 public:
80 
81  //- Runtime type information
82  TypeName("cellPointFace");
83 
84 
85  // Constructors
86 
87  //- Construct from components
89  (
90  const VolField<Type>& psi
91  );
92 
93  //- Copy construct
95  (
97  );
98 
99  //- Clone
100  virtual autoPtr<interpolation<Type>> clone() const
101  {
103  (
105  );
106  }
107 
108 
109  // Member Functions
110 
111  //- Inherit interpolate from interpolation
113 
114  //- Interpolate field to the given point in the given cell
115  Type interpolate
116  (
117  const vector& position,
118  const label celli,
119  const label facei = -1
120  ) const;
121 };
122 
123 
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 
126 } // End namespace Foam
127 
128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 
130 #ifdef NoRepository
132 #endif
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 #endif
137 
138 // ************************************************************************* //
Generic GeometricField class.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
Foam::interpolationCellPointFace.
interpolationCellPointFace(const VolField< Type > &psi)
Construct from components.
virtual autoPtr< interpolation< Type > > clone() const
Clone.
TypeName("cellPointFace")
Runtime type information.
Type interpolate(const vector &position, const label celli, const label facei=-1) const
Interpolate field to the given point in the given cell.
Base class for interpolations that require a vol-point interpolated field.
Abstract base class for interpolation.
Definition: interpolation.H:55
const VolField< Type > & psi() const
Return the field to be interpolated.
Namespace for OpenFOAM.
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