copiedFixedValueFvPatchScalarField.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) 2015-2020 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 
27 #include "fvPatchFieldMapper.H"
28 #include "volFields.H"
30 
31 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
32 
34 (
35  const fvPatch& p,
36  const DimensionedField<scalar, volMesh>& iF
37 )
38 :
39  fixedValueFvPatchScalarField(p, iF),
40  sourceFieldName_("default")
41 {}
42 
43 
45 (
46  const fvPatch& p,
47  const DimensionedField<scalar, volMesh>& iF,
48  const dictionary& dict
49 )
50 :
51  fixedValueFvPatchScalarField(p, iF, dict),
52  sourceFieldName_(dict.lookup("sourceFieldName"))
53 {}
54 
55 
57 (
58  const copiedFixedValueFvPatchScalarField& ptf,
59  const fvPatch& p,
60  const DimensionedField<scalar, volMesh>& iF,
61  const fvPatchFieldMapper& mapper
62 )
63 :
64  fixedValueFvPatchScalarField(ptf, p, iF, mapper),
65  sourceFieldName_(ptf.sourceFieldName_)
66 {}
67 
68 
70 (
71  const copiedFixedValueFvPatchScalarField& awfpsf,
72  const DimensionedField<scalar, volMesh>& iF
73 )
74 :
75  fixedValueFvPatchScalarField(awfpsf, iF),
76  sourceFieldName_(awfpsf.sourceFieldName_)
77 {}
78 
79 
80 
81 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
82 
84 {
85  if (this->updated())
86  {
87  return;
88  }
89 
90  operator==
91  (
92  patch().lookupPatchField<volScalarField, scalar>(sourceFieldName_)
93  );
94 
95  fixedValueFvPatchScalarField::updateCoeffs();
96 }
97 
98 
100 {
102  writeEntry(os, "sourceFieldName", sourceFieldName_);
103  writeEntry(os, "value", *this);
104 }
105 
106 
107 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
108 
109 namespace Foam
110 {
112  (
114  copiedFixedValueFvPatchScalarField
115  );
116 }
117 
118 
119 // ************************************************************************* //
dictionary dict
copiedFixedValueFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
virtual void write(Ostream &) const
Write.
Definition: fvPatchField.C:243
Macros for easy insertion into run-time selection tables.
virtual void write(Ostream &) const
Write.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:58
stressControl lookup("compactNormalStress") >> compactNormalStress
fvPatchField< scalar > fvPatchScalarField
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
Definition: HashTableIO.C:96
volScalarField & p
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
makePatchTypeField(fvPatchScalarField, thermalBaffleFvPatchScalarField)
Namespace for OpenFOAM.