WallLocationDataI.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2023 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 
26 #include "WallLocationData.H"
27 #include "transformer.H"
28 
29 // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
30 
31 template<class WallLocation, class Type>
32 template<class TrackingData>
34 (
35  const point& pt,
37  const scalar tol,
38  TrackingData& td
39 )
40 {
41  const bool result = WallLocation::update(pt, w2, tol, td);
42 
43  if (result)
44  {
45  data_ = w2.data();
46  }
47 
48  return result;
49 }
50 
51 
52 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
53 
54 template<class WallLocation, class Type>
56 :
57  WallLocation(),
58  data_()
59 {}
60 
61 
62 template<class WallLocation, class Type>
63 template<class ... Geometry>
65 (
66  const Type& data,
67  const Geometry& ... geometry
68 )
69 :
70  WallLocation(geometry ...),
71  data_(data)
72 {}
73 
74 
75 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
76 
77 template<class WallLocation, class Type>
79 {
80  return data_;
81 }
82 
83 
84 template<class WallLocation, class Type>
86 {
87  return data_;
88 }
89 
90 
91 template<class WallLocation, class Type>
92 template<class TrackingData>
94 (
95  TrackingData& td
96 ) const
97 {
98  return data_;
99 }
100 
101 
102 template<class WallLocation, class Type>
103 template<class TrackingData>
105 (
106  const transformer& transform,
107  TrackingData& td
108 )
109 {
111 
112  data_ = transform.transform(data_);
113 }
114 
115 
116 // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
117 
118 template<class WallLocation, class Type>
119 Foam::Ostream& Foam::operator<<
120 (
121  Ostream& os,
123 )
124 {
125  return
126  os << static_cast<const WallLocation&>(w) << token::SPACE << w.data();
127 }
128 
129 
130 template<class WallLocation, class Type>
131 Foam::Istream& Foam::operator>>
132 (
133  Istream& is,
135 )
136 {
137  return is >> static_cast<WallLocation&>(w) >> w.data_;
138 }
139 
140 
141 // ************************************************************************* //
#define w2
Definition: blockCreate.C:32
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:60
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
Holds information regarding nearest wall point. Used in wall distance calculation.
void transform(const transformer &transform, TrackingData &td)
Transform across an interface.
bool update(const point &pt, const WallLocationData< WallLocation, Type > &w2, const scalar tol, TrackingData &td)
Evaluate distance to point. Update distSqr, origin from whomever.
WallLocationData()
Construct null.
const Type & data() const
friend dimensionSet transform(const dimensionSet &)
Vector-tensor class used to perform translations, rotations and scaling operations in 3D space.
Definition: transformer.H:84
dimensionSet transform(const dimensionSet &)
Definition: dimensionSet.C:504