interpolationCellPointWallModifiedI.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) 2011-2017 OpenFOAM Foundation
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 \*---------------------------------------------------------------------------*/
27 
28 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
29 
30 template<class Type>
32 (
34 ) const
35 {
36  const barycentric& weights = cpw.weights();
37  const triFace& faceVertices = cpw.faceVertices();
38 
39  Type t = this->psi_[cpw.cell()]*weights[0];
40  t += this->psip_[faceVertices[0]]*weights[1];
41  t += this->psip_[faceVertices[1]]*weights[2];
42  t += this->psip_[faceVertices[2]]*weights[3];
43 
44  return t;
45 }
46 
47 
48 template<class Type>
50 (
51  const vector& position,
52  const label celli,
53  const label facei
54 ) const
55 {
56  return interpolate
57  (
59  (
60  this->pMesh_,
61  position,
62  celli,
63  facei
64  )
65  );
66 }
67 
68 
69 template<class Type>
71 (
72  const barycentric& coordinates,
73  const tetIndices& tetIs,
74  const label facei
75 ) const
76 {
77  if (facei >= 0)
78  {
79  if (facei != tetIs.face())
80  {
82  << "specified face " << facei << " inconsistent with the face "
83  << "stored by tetIndices: " << tetIs.face()
84  << exit(FatalError);
85  }
86 
87  const polyBoundaryMesh& bm = this->pMesh_.boundaryMesh();
88  label patchi = bm.whichPatch(facei);
89 
90  if (patchi != -1)
91  {
92  if (isA<wallPolyPatch>(bm[patchi]))
93  {
94  Type t = this->psi_[tetIs.cell()];
95 
96  return t;
97  }
98  }
99  }
100 
101  // If the wall face selection did not return, then use the normal
102  // interpolate method
103 
105  (
106  coordinates,
107  tetIs,
108  facei
109  );
110 }
111 
112 
113 // ************************************************************************* //
Foam::tetIndices::cell
label cell() const
Return the cell.
Definition: tetIndicesI.H:31
Foam::polyBoundaryMesh
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
Definition: polyBoundaryMesh.H:63
Foam::cellPointWeight::faceVertices
const triFace & faceVertices() const
Interpolation addressing for points on face.
Definition: cellPointWeight.H:125
Foam::tetIndices::face
label face() const
Return the face.
Definition: tetIndicesI.H:43
Foam::cellPointWeightWallModified
Foam::cellPointWeightWallModified.
Definition: cellPointWeightWallModified.H:55
coordinates
PtrList< coordinateSystem > coordinates(solidRegions.size())
Foam::Barycentric< scalar >
Foam::polyBoundaryMesh::whichPatch
label whichPatch(const label faceIndex) const
Return patch index for a given face label.
Definition: polyBoundaryMesh.C:812
Foam::FatalError
error FatalError
Foam::cellPointWeight::cell
label cell() const
Cell index.
Definition: cellPointWeight.H:113
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
Foam::tetIndices
Storage and named access for the indices of a tet which is part of the decomposition of a cell.
Definition: tetIndices.H:83
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
Foam::interpolationCellPointWallModified::interpolate
Type interpolate(const cellPointWeightWallModified &cpw) const
Interpolate field for the given cellPointWeight.
Definition: interpolationCellPointWallModifiedI.H:32
Foam::triFace
A triangular face using a FixedList of labels corresponding to mesh vertices.
Definition: triFace.H:69
Foam::cellPointWeight::weights
const barycentric & weights() const
Interpolation weights.
Definition: cellPointWeight.H:119
Foam::Vector< scalar >
Foam::fac::interpolate
static tmp< GeometricField< Type, faePatchField, edgeMesh > > interpolate(const GeometricField< Type, faPatchField, areaMesh > &tvf, const edgeScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.