edgeNormalFixedValueFaPatchVectorField.C
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) 2016-2017 Wikki Ltd
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 \*---------------------------------------------------------------------------*/
27 
30 #include "areaFields.H"
31 #include "faPatchFieldMapper.H"
32 
33 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
34 
37 (
38  const faPatch& p,
40 )
41 :
42  fixedValueFaPatchVectorField(p, iF),
43  refValue_(p.size(), Zero)
44 {}
45 
46 
49 (
50  const faPatch& p,
52  const scalar refValue
53 )
54 :
55  fixedValueFaPatchVectorField(p, iF),
56  refValue_(p.size(), refValue)
57 {}
58 
59 
62 (
64  const faPatch& p,
66  const faPatchFieldMapper& mapper
67 )
68 :
69  fixedValueFaPatchVectorField(ptf, p, iF, mapper),
70  refValue_(ptf.refValue_, mapper)
71 {}
72 
73 
76 (
77  const faPatch& p,
79  const dictionary& dict
80 )
81 :
82  fixedValueFaPatchVectorField(p, iF, dict, IOobjectOption::NO_READ),
83  refValue_("refValue", dict, p.size())
84 {
85  tmp<vectorField> tvalues(refValue_*patch().edgeNormals());
86 
88 }
89 
90 
93 (
95 )
96 :
97  fixedValueFaPatchVectorField(pivpvf),
98  refValue_(pivpvf.refValue_)
99 {}
100 
101 
104 (
107 )
108 :
109  fixedValueFaPatchVectorField(pivpvf, iF),
110  refValue_(pivpvf.refValue_)
111 {}
112 
113 
114 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
115 
117 (
118  const faPatchFieldMapper& m
119 )
120 {
121  fixedValueFaPatchVectorField::autoMap(m);
122  refValue_.autoMap(m);
123 }
124 
125 
127 (
128  const faPatchVectorField& ptf,
129  const labelList& addr
130 )
131 {
132  fixedValueFaPatchVectorField::rmap(ptf, addr);
133 
135  refCast<const edgeNormalFixedValueFaPatchVectorField>(ptf);
136 
137  refValue_.rmap(tiptf.refValue_, addr);
138 }
139 
140 
142 {
143  if (updated())
144  {
145  return;
146  }
147 
148  tmp<vectorField> tvalues(refValue_*patch().edgeNormals());
149 
152 }
153 
154 
156 {
158  refValue_.writeEntry("refValue", os);
159 }
160 
161 
162 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
163 
164 namespace Foam
165 {
167  (
169  edgeNormalFixedValueFaPatchVectorField
170  );
171 }
172 
173 
174 // ************************************************************************* //
dictionary dict
virtual void write(Ostream &) const
Write.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
Edge normal fixed value vector field finite area boundary condition.
faPatchField<Type> abstract base class. This class gives a fat-interface to all derived classes cover...
Definition: areaFieldsFwd.H:56
virtual void autoMap(const faPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Macros for easy insertion into run-time selection tables.
virtual void rmap(const faPatchVectorField &, const labelList &)
Reverse map the given faPatchField onto this faPatchField.
makeFaPatchTypeField(faPatchVectorField, edgeNormalFixedValueFaPatchVectorField)
edgeNormalFixedValueFaPatchVectorField(const faPatch &, const DimensionedField< vector, areaMesh > &)
Construct from patch and internal field.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
OBJstream os(runTime.globalPath()/outputName)
Finite area patch class. Used for 2-D non-Euclidian finite area method.
Definition: faPatch.H:72
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: faPatchField.C:234
virtual void operator=(const UList< Type > &)
Definition: faPatchField.C:268
A simple container of IOobject preferences. Can also be used for general handling of read/no-read/rea...
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: areaFieldsFwd.H:42
const std::string patch
OpenFOAM patch number as a std::string.
faPatchField< vector > faPatchVectorField
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
volScalarField & p
A class for managing temporary objects.
Definition: HashPtrTable.H:50
A FieldMapper for finite-area patch fields.
Namespace for OpenFOAM.
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:127