cellPointWeight.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 Class
27  Foam::cellPointWeight
28 
29 Description
30  Foam::cellPointWeight
31 
32 SourceFiles
33  cellPointWeight.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef cellPointWeight_H
38 #define cellPointWeight_H
39 
40 #include "vector.H"
41 #include "barycentric.H"
42 #include "triFace.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 class polyMesh;
50 
51 /*---------------------------------------------------------------------------*\
52  Class cellPointWeight Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 class cellPointWeight
56 {
57 protected:
58 
59  // Protected data
60 
61  //- Cell index
62  const label celli_;
63 
64  //- Weights applied to tet vertices. Equal to the barycentric coordinates
65  // of the interpolation position.
67 
68  //- Face vertex indices
70 
71 
72  // Protected Member Functions
73 
74  void findTetrahedron
75  (
76  const polyMesh& mesh,
77  const vector& position,
78  const label celli
79  );
80 
81  void findTriangle
82  (
83  const polyMesh& mesh,
84  const vector& position,
85  const label facei
86  );
87 
88 
89 public:
90 
91  //- Debug switch
92  static int debug;
93 
94  //- Tolerance used in calculating barycentric coordinates
95  // (applied to normalised values)
96  static scalar tol;
97 
98 
99  // Constructors
100 
101  //- Construct from components
103  (
104  const polyMesh& mesh,
105  const vector& position,
106  const label celli,
107  const label facei = -1
108  );
109 
110 
111  // Member Functions
112 
113  //- Cell index
114  inline label cell() const
115  {
116  return celli_;
117  }
118 
119  //- Interpolation weights
120  inline const barycentric& weights() const
121  {
122  return weights_;
123  }
124 
125  //- Interpolation addressing for points on face
126  inline const triFace& faceVertices() const
127  {
128  return faceVertices_;
129  }
130 };
131 
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 } // End namespace Foam
136 
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 
139 #endif
140 
141 // ************************************************************************* //
Foam::cellPointWeight::weights_
barycentric weights_
Weights applied to tet vertices. Equal to the barycentric coordinates.
Definition: cellPointWeight.H:65
Foam::cellPointWeight::findTriangle
void findTriangle(const polyMesh &mesh, const vector &position, const label facei)
Definition: cellPointWeight.C:135
Foam::cellPointWeight::faceVertices_
triFace faceVertices_
Face vertex indices.
Definition: cellPointWeight.H:68
Foam::cellPointWeight::tol
static scalar tol
Tolerance used in calculating barycentric coordinates.
Definition: cellPointWeight.H:95
Foam::cellPointWeight::faceVertices
const triFace & faceVertices() const
Interpolation addressing for points on face.
Definition: cellPointWeight.H:125
Foam::cellPointWeight::celli_
const label celli_
Cell index.
Definition: cellPointWeight.H:61
triFace.H
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::cellPointWeight::debug
static int debug
Debug switch.
Definition: cellPointWeight.H:91
Foam::cellPointWeight::cellPointWeight
cellPointWeight(const polyMesh &mesh, const vector &position, const label celli, const label facei=-1)
Construct from components.
Definition: cellPointWeight.C:243
Foam::Barycentric< scalar >
Foam::cellPointWeight
Foam::cellPointWeight.
Definition: cellPointWeight.H:54
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::cellPointWeight::cell
label cell() const
Cell index.
Definition: cellPointWeight.H:113
Foam::triFace
A triangular face using a FixedList of labels corresponding to mesh vertices.
Definition: triFace.H:70
Foam::cellPointWeight::weights
const barycentric & weights() const
Interpolation weights.
Definition: cellPointWeight.H:119
barycentric.H
Foam::Vector< scalar >
vector.H
Foam::cellPointWeight::findTetrahedron
void findTetrahedron(const polyMesh &mesh, const vector &position, const label celli)
Definition: cellPointWeight.C:41