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-------------------------------------------------------------------------------
11License
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 {
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// ************************************************************************* //
Foam::cellPointWeightWallModified.
static bool onWall(const polyMesh &mesh, const label facei)
True if face is on a wall path.
Foam::cellPointWeight.
barycentric weights_
Weights applied to tet vertices.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
label whichPatch(const label faceIndex) const
Return patch index for a given face label.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Definition: polyMesh.H:456
dynamicFvMesh & mesh