uniformFixedValueFvPatchField.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-2015 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 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
29 
30 template<class Type>
32 (
33  const fvPatch& p,
35 )
36 :
38  uniformValue_()
39 {}
40 
41 
42 template<class Type>
44 (
45  const fvPatch& p,
47  const Field<Type>& fld
48 )
49 :
51  uniformValue_()
52 {}
53 
54 
55 template<class Type>
57 (
59  const fvPatch& p,
61  const fvPatchFieldMapper& mapper
62 )
63 :
64  fixedValueFvPatchField<Type>(p, iF), // bypass mapper
65  uniformValue_(ptf.uniformValue_().clone().ptr())
66 {
67  // Evaluate since value not mapped
68  const scalar t = this->db().time().timeOutputValue();
69  fvPatchField<Type>::operator==(uniformValue_->value(t));
70 }
71 
72 
73 template<class Type>
75 (
76  const fvPatch& p,
78  const dictionary& dict
79 )
80 :
82  uniformValue_(DataEntry<Type>::New("uniformValue", dict))
83 {
84  const scalar t = this->db().time().timeOutputValue();
85  fvPatchField<Type>::operator==(uniformValue_->value(t));
86 }
87 
88 
89 template<class Type>
91 (
93 )
94 :
96  uniformValue_
97  (
98  ptf.uniformValue_.valid()
99  ? ptf.uniformValue_().clone().ptr()
100  : NULL
101  )
102 {}
103 
104 
105 template<class Type>
107 (
110 )
111 :
113  uniformValue_
114  (
115  ptf.uniformValue_.valid()
116  ? ptf.uniformValue_().clone().ptr()
117  : NULL
118  )
119 {
120  // For safety re-evaluate
121  const scalar t = this->db().time().timeOutputValue();
122 
123  if (ptf.uniformValue_.valid())
124  {
125  fvPatchField<Type>::operator==(uniformValue_->value(t));
126  }
127 }
128 
129 
130 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
131 
132 template<class Type>
134 {
135  if (this->updated())
136  {
137  return;
138  }
139 
140  const scalar t = this->db().time().timeOutputValue();
141  fvPatchField<Type>::operator==(uniformValue_->value(t));
142 
144 }
145 
146 
147 template<class Type>
149 {
151  uniformValue_->writeData(os);
152  this->writeEntry("value", os);
153 }
154 
155 
156 // ************************************************************************* //
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Foam::fvPatchFieldMapper.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
runTime write()
uniformFixedValueFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
volScalarField & p
Definition: createFields.H:51
Pre-declare SubField and related Field type.
Definition: Field.H:57
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().x()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().y()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().z()<< ' ';}gmvFile<< nl;forAll(lagrangianScalarNames, i){const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject( name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE ))
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
virtual void write(Ostream &) const
Write.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
Definition: DataEntry.H:52
This boundary condition provides a uniform fixed value condition.
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.