uniformFixedValuePointPatchField.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 | Copyright (C) 2011-2012 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 
28 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
29 
30 namespace Foam
31 {
32 
33 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //
34 
35 template<class Type>
38 (
39  const pointPatch& p,
41 )
42 :
44  uniformValue_()
45 {}
46 
47 
48 template<class Type>
51 (
52  const pointPatch& p,
54  const dictionary& dict
55 )
56 :
58  uniformValue_(DataEntry<Type>::New("uniformValue", dict))
59 {
60  if (dict.found("value"))
61  {
63  (
64  Field<Type>("value", dict, p.size())
65  );
66  }
67  else
68  {
69  const scalar t = this->db().time().timeOutputValue();
70  fixedValuePointPatchField<Type>::operator=(uniformValue_->value(t));
71  }
72 }
73 
74 
75 template<class Type>
78 (
80  const pointPatch& p,
82  const pointPatchFieldMapper& mapper
83 )
84 :
85  fixedValuePointPatchField<Type>(ptf, p, iF, mapper),
86  uniformValue_(ptf.uniformValue_().clone().ptr())
87 {
88  // For safety re-evaluate
89  const scalar t = this->db().time().timeOutputValue();
90  fixedValuePointPatchField<Type>::operator=(uniformValue_->value(t));
91 }
92 
93 
94 template<class Type>
97 (
99 )
100 :
102  uniformValue_(ptf.uniformValue_().clone().ptr())
103 {}
104 
105 
106 template<class Type>
109 (
112 )
113 :
115  uniformValue_(ptf.uniformValue_().clone().ptr())
116 {
117  // For safety re-evaluate
118  const scalar t = this->db().time().timeOutputValue();
119  fixedValuePointPatchField<Type>::operator==(uniformValue_->value(t));
120 }
121 
122 
123 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
124 
125 template<class Type>
127 {
128  if (this->updated())
129  {
130  return;
131  }
132 
133  const scalar t = this->db().time().timeOutputValue();
134  fixedValuePointPatchField<Type>::operator==(uniformValue_->value(t));
135 
137 }
138 
139 
140 template<class Type>
142 write(Ostream& os) const
143 {
144  // Note: write value
146  uniformValue_->writeData(os);
147 }
148 
149 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
152 } // End namespace Foam
153 
154 // ************************************************************************* //
p
p
Definition: pEqn.H:62
uniformFixedValuePointPatchField.H
Foam::pointPatch
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:56
Foam::uniformFixedValuePointPatchField::uniformValue_
autoPtr< DataEntry< Type > > uniformValue_
Definition: uniformFixedValuePointPatchField.H:69
Foam::pointPatchFieldMapper
Foam::pointPatchFieldMapper.
Definition: pointPatchFieldMapper.H:46
Foam::fixedValuePointPatchField
A FixedValue boundary condition for pointField.
Definition: fixedValuePointPatchField.H:49
Foam::dictionary::found
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
Definition: dictionary.C:304
Foam::Field< Type >
Foam::valuePointPatchField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: valuePointPatchField.C:150
Foam::uniformFixedValuePointPatchField::uniformFixedValuePointPatchField
uniformFixedValuePointPatchField(const pointPatch &, const DimensionedField< Type, pointMesh > &)
Construct from patch and internal field.
Definition: uniformFixedValuePointPatchField.C:38
Foam::fixedValuePointPatchField::operator=
virtual void operator=(const Field< Type > &)
Definition: fixedValuePointPatchField.H:138
Foam::valuePointPatchField::write
virtual void write(Ostream &) const
Write.
Definition: valuePointPatchField.C:179
Foam::valuePointPatchField::operator==
virtual void operator==(const valuePointPatchField< Type > &)
Definition: valuePointPatchField.C:231
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::uniformFixedValuePointPatchField
Enables the specification of a uniform fixed value boundary condition.
Definition: uniformFixedValuePointPatchField.H:63
Foam::uniformFixedValuePointPatchField::write
virtual void write(Ostream &) const
Write.
Definition: uniformFixedValuePointPatchField.C:142
Foam::uniformFixedValuePointPatchField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: uniformFixedValuePointPatchField.C:126
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::DataEntry
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
Definition: DataEntry.H:52
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51