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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2022 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
30 #include "polyMesh.H"
31 #include "polyBoundaryMesh.H"
32 #include "wallPolyPatch.H"
33 
34 // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
35 
37 (
38  const polyMesh& mesh,
39  const label facei
40 )
41 {
42  if (facei >= 0)
43  {
44  const polyBoundaryMesh& bm = mesh.boundaryMesh();
45  const label patchi = bm.whichPatch(facei);
46 
47  if (patchi != -1 && isA<wallPolyPatch>(bm[patchi]))
48  {
49  return true;
50  }
51  }
52 
53  return false;
54 }
55 
56 
57 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
58 
60 (
61  const polyMesh& mesh,
62  const vector& position,
63  const label celli,
64  const label facei
65 )
66 :
67  cellPointWeight(mesh, position, celli, facei)
68 {
69  if (facei >= 0 && cellPointWeightWallModified::onWall(mesh, facei))
70  {
71  // Apply cell centre value for wall faces
72  weights_[0] = 1;
73  weights_[1] = 0;
74  weights_[2] = 0;
75  weights_[3] = 0;
76  }
77 }
78 
79 
80 // ************************************************************************* //
barycentric weights_
Weights applied to tet vertices.
static bool onWall(const polyMesh &mesh, const label facei)
True if face is on a wall path.
dynamicFvMesh & mesh
label whichPatch(const label meshFacei) const
Return patch index for a given mesh face index. Uses binary search.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO...
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
cellPointWeightWallModified(const polyMesh &mesh, const vector &position, const label celli, const label facei=-1)
Construct from components.
Foam::cellPointWeight.