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-2018 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_(ptf.refValue_, mapper)
71 {
72  // Note: calculate product only on ptf to avoid multiplication on
73  // unset values in reconstructPar.
74  fvPatchVectorField::operator=
75  (
77  (
78  ptf.refValue_*ptf.patch().nf(),
79  mapper
80  )
81  );
82 }
83 
84 
87 (
89 )
90 :
91  fixedValueFvPatchVectorField(pivpvf),
92  refValue_(pivpvf.refValue_)
93 {}
94 
95 
98 (
101 )
102 :
103  fixedValueFvPatchVectorField(pivpvf, iF),
104  refValue_(pivpvf.refValue_)
105 {}
106 
107 
108 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
109 
111 (
112  const fvPatchFieldMapper& m
113 )
114 {
115  fixedValueFvPatchVectorField::autoMap(m);
116  refValue_.autoMap(m);
117 }
118 
119 
121 (
122  const fvPatchVectorField& ptf,
123  const labelList& addr
124 )
125 {
126  fixedValueFvPatchVectorField::rmap(ptf, addr);
127 
129  refCast<const surfaceNormalFixedValueFvPatchVectorField>(ptf);
130 
131  refValue_.rmap(tiptf.refValue_, addr);
132 }
133 
134 
136 {
137  if (updated())
138  {
139  return;
140  }
141 
142  fvPatchVectorField::operator=(refValue_*patch().nf());
144 }
145 
146 
148 {
150  refValue_.writeEntry("refValue", os);
151 }
152 
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 namespace Foam
157 {
159  (
162  );
163 }
164 
165 // ************************************************************************* //
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:137
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
void writeEntry(const word &keyword, Ostream &os) const
Write the field as a dictionary entry.
Definition: Field.C:726
volVectorField vectorField(fieldObject, mesh)
virtual void write(Ostream &) const
Write.
Definition: fvPatchField.C:362
Macros for easy insertion into run-time selection tables.
This boundary condition provides a surface-normal vector boundary condition by its magnitude...
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Foam::fvPatchFieldMapper.
virtual label size() const
Return size.
Definition: fvPatch.H:161
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: fvPatchField.C:311
virtual void operator=(const UList< Type > &)
Definition: fvPatchField.C:395
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.