FvWallInfoDataI.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-2022 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 "FvWallInfoData.H"
27 
28 // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
29 
30 template<class WallInfo, class Type, class Derived>
31 template<class TrackingData>
33 (
34  const point& pt,
36  const scalar tol,
37  TrackingData& td
38 )
39 {
40  const bool result =
42 
43  if (result)
44  {
45  data_ = w2.data();
46  }
47 
48  return result;
49 }
50 
51 
52 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
53 
54 template<class WallInfo, class Type, class Derived>
56 :
57  FvWallInfoBase<WallInfo, Derived>(),
58  data_()
59 {}
60 
61 
62 template<class WallInfo, class Type, class Derived>
63 template<class ... Geometry>
65 (
66  const Type& data,
67  const Geometry& ... geometry
68 )
69 :
71  data_(data)
72 {}
73 
74 
75 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
76 
77 template<class WallInfo, class Type, class Derived>
78 inline const Type&
80 {
81  return data_;
82 }
83 
84 
85 template<class WallInfo, class Type, class Derived>
86 inline Type&
88 {
89  return data_;
90 }
91 
92 
93 template<class WallInfo, class Type, class Derived>
94 template<class TrackingData>
95 inline const Type&
97 {
98  return data_;
99 }
100 
101 
102 template<class WallInfo, class Type, class Derived>
103 template<class TrackingData>
105 (
106  const fvPatch& patch,
107  const label patchFacei,
108  const transformer& transform,
109  TrackingData& td
110 )
111 {
113  (
114  patch,
115  patchFacei,
116  transform,
117  td
118  );
119 
120  data_ = transform.transform(data_);
121 }
122 
123 
124 // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
125 
126 template<class WallInfo, class Type, class Derived>
127 Foam::Ostream& Foam::operator<<
128 (
129  Ostream& os,
131 )
132 {
133  return os
134  << static_cast<const FvWallInfoBase<WallInfo, Derived>&>(w)
135  << token::SPACE
136  << w.data();
137 }
138 
139 
140 template<class WallInfo, class Type, class Derived>
141 Foam::Istream& Foam::operator>>
142 (
143  Istream& is,
145 )
146 {
147  return is
148  >> static_cast<FvWallInfoBase<WallInfo, Derived>&>(w)
149  >> w.data_;
150 }
151 
152 
153 // ************************************************************************* //
Vector-tensor class used to perform translations, rotations and scaling operations in 3D space...
Definition: transformer.H:83
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:63
const Type & data() const
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
Database for solution and other reduced data.
Definition: data.H:51
FvWallInfoDataBase()
Construct null.
bool update(const point &, const FvWallInfoDataBase< WallInfo, Type, Derived > &w2, const scalar tol, TrackingData &td)
Evaluate distance to point. Update distSqr, origin from whomever.
void transform(const fvPatch &patch, const label patchFacei, const transformer &transform, TrackingData &td)
Transform across an interface.
Type transform(const Type &) const
Transform the given type.
dimensionSet transform(const dimensionSet &)
Definition: dimensionSet.C:483