cellPointWeightWallModified.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011 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 \*---------------------------------------------------------------------------*/
25 
27 
28 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
29 
31 (
32  const polyMesh& mesh,
33  const vector& position,
34  const label cellI,
35  const label faceI
36 )
37 :
38  cellPointWeight(mesh, position, cellI, faceI)
39 {
40  // findTetrahedron or findTriangle will already have been called
41  // by the cellPointWeight constructor
42 
43  if (faceI >= 0)
44  {
45  const polyBoundaryMesh& bm = mesh.boundaryMesh();
46  label patchI = bm.whichPatch(faceI);
47  if (patchI != -1)
48  {
49  if (isA<wallPolyPatch>(bm[patchI]))
50  {
51  // Apply cell centre value wall faces
52  weights_[0] = 1.0;
53  weights_[1] = 0.0;
54  weights_[2] = 0.0;
55  weights_[3] = 0.0;
56  }
57  }
58  }
59 }
60 
61 
62 // ************************************************************************* //
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
cellPointWeightWallModified(const polyMesh &mesh, const vector &position, const label cellI, const label faceI=-1)
Construct from components.
Foam::polyBoundaryMesh.
label whichPatch(const label faceIndex) const
Return patch index for a given face label.
Foam::cellPointWeight.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Definition: polyMesh.H:421
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74