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(), 0)
44 {}
45 
46 
49 (
51  const faPatch& p,
53  const faPatchFieldMapper& mapper
54 )
55 :
56  fixedValueFaPatchVectorField(ptf, p, iF, mapper),
57  refValue_(ptf.refValue_, mapper)
58 {}
59 
60 
63 (
64  const faPatch& p,
66  const dictionary& dict
67 )
68 :
69  fixedValueFaPatchVectorField(p, iF, dict),
70  refValue_("refValue", dict, p.size())
71 {}
72 
73 
76 (
78 )
79 :
80  fixedValueFaPatchVectorField(pivpvf),
81  refValue_(pivpvf.refValue_)
82 {}
83 
84 
87 (
90 )
91 :
92  fixedValueFaPatchVectorField(pivpvf, iF),
93  refValue_(pivpvf.refValue_)
94 {}
95 
96 
97 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
98 
100 (
101  const faPatchFieldMapper& m
102 )
103 {
104  fixedValueFaPatchVectorField::autoMap(m);
105  refValue_.autoMap(m);
106 }
107 
108 
110 (
111  const faPatchVectorField& ptf,
112  const labelList& addr
113 )
114 {
115  fixedValueFaPatchVectorField::rmap(ptf, addr);
116 
118  refCast<const edgeNormalFixedValueFaPatchVectorField>(ptf);
119 
120  refValue_.rmap(tiptf.refValue_, addr);
121 }
122 
123 
125 {
126  if (updated())
127  {
128  return;
129  }
130 
131  operator==(refValue_*patch().edgeNormals());
132 }
133 
134 
136 {
138  refValue_.writeEntry("refValue", os);
139 }
140 
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 namespace Foam
145 {
146 
148 (
151 );
152 
153 } // End namespace Foam
154 
155 
156 // ************************************************************************* //
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::faPatchField
faPatchField<Type> abstract base class. This class gives a fat-interface to all derived classes cover...
Definition: areaFieldsFwd.H:50
Foam::edgeNormalFixedValueFaPatchVectorField::rmap
virtual void rmap(const faPatchVectorField &, const labelList &)
Reverse map the given faPatchField onto this faPatchField.
Definition: edgeNormalFixedValueFaPatchVectorField.C:110
Foam::makeFaPatchTypeField
makeFaPatchTypeField(faPatchVectorField, edgeNormalFixedValueFaPatchVectorField)
Foam::edgeNormalFixedValueFaPatchVectorField::write
virtual void write(Ostream &) const
Write.
Definition: edgeNormalFixedValueFaPatchVectorField.C:135
Foam::faPatchFieldMapper
Definition: faPatchFieldMapper.H:44
faPatchFieldMapper.H
Foam::operator==
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
areaFields.H
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
os
OBJstream os(runTime.globalPath()/outputName)
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam::edgeNormalFixedValueFaPatchVectorField::autoMap
virtual void autoMap(const faPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: edgeNormalFixedValueFaPatchVectorField.C:100
edgeNormalFixedValueFaPatchVectorField.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::foamVersion::patch
const std::string patch
OpenFOAM patch number as a std::string.
Foam::List< label >
Foam::vtk::write
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
Definition: foamVtkOutputTemplates.C:36
Foam::edgeNormalFixedValueFaPatchVectorField
Edge normal fixed value vector field finite area boundary condition.
Definition: edgeNormalFixedValueFaPatchVectorField.H:58
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::faPatch
Finite area patch class. Used for 2-D non-Euclidian finite area method.
Definition: faPatch.H:69
Foam::edgeNormalFixedValueFaPatchVectorField::edgeNormalFixedValueFaPatchVectorField
edgeNormalFixedValueFaPatchVectorField(const faPatch &, const DimensionedField< vector, areaMesh > &)
Construct from patch and internal field.
Definition: edgeNormalFixedValueFaPatchVectorField.C:37
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54
Foam::edgeNormalFixedValueFaPatchVectorField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: edgeNormalFixedValueFaPatchVectorField.C:124