surfaceNormalFixedValueFvPatchVectorField.C
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-2019 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 
28 #include "volFields.H"
29 #include "fvPatchFieldMapper.H"
30 
31 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
32 
35 (
36  const fvPatch& p,
38 )
39 :
40  fixedValueFvPatchVectorField(p, iF),
41  refValue_(p.size())
42 {}
43 
44 
47 (
48  const fvPatch& p,
50  const dictionary& dict
51 )
52 :
53  fixedValueFvPatchVectorField(p, iF, dict, false),
54  refValue_("refValue", dict, p.size())
55 {
56  fvPatchVectorField::operator=(refValue_*patch().nf());
57 }
58 
59 
62 (
64  const fvPatch& p,
66  const fvPatchFieldMapper& mapper
67 )
68 :
69  fixedValueFvPatchVectorField(p, iF),
70  refValue_(mapper(ptf.refValue_))
71 {
72  // Note: calculate product only on ptf to avoid multiplication on
73  // unset values in reconstructPar.
74  fvPatchVectorField::operator=
75  (
76  mapper(ptf.refValue_*ptf.patch().nf())
77  );
78 }
79 
80 
83 (
85 )
86 :
87  fixedValueFvPatchVectorField(pivpvf),
88  refValue_(pivpvf.refValue_)
89 {}
90 
91 
94 (
97 )
98 :
99  fixedValueFvPatchVectorField(pivpvf, iF),
100  refValue_(pivpvf.refValue_)
101 {}
102 
103 
104 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
105 
107 (
108  const fvPatchFieldMapper& m
109 )
110 {
111  fixedValueFvPatchVectorField::autoMap(m);
112  m(refValue_, refValue_);
113 }
114 
115 
117 (
118  const fvPatchVectorField& ptf,
119  const labelList& addr
120 )
121 {
122  fixedValueFvPatchVectorField::rmap(ptf, addr);
123 
125  refCast<const surfaceNormalFixedValueFvPatchVectorField>(ptf);
126 
127  refValue_.rmap(tiptf.refValue_, addr);
128 }
129 
130 
132 {
133  if (updated())
134  {
135  return;
136  }
137 
138  fvPatchVectorField::operator=(refValue_*patch().nf());
140 }
141 
142 
144 {
146  writeEntry(os, "refValue", refValue_);
147 }
148 
149 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
152 namespace Foam
153 {
155  (
158  );
159 }
160 
161 // ************************************************************************* //
surfaceNormalFixedValueFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
virtual void rmap(const fvPatchVectorField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:66
virtual void write(Ostream &) const
Write.
Definition: fvPatchField.C:280
Macros for easy insertion into run-time selection tables.
Surface-normal fixed value vector boundary condition.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Foam::fvPatchFieldMapper.
virtual label size() const
Return size.
Definition: fvPatch.H:155
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
Definition: HashTableIO.C:96
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: fvPatchField.C:229
virtual void operator=(const UList< Type > &)
Definition: fvPatchField.C:295
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
Namespace for OpenFOAM.