uniformFixedValueFvPatchField.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) 2011-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 
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 (
58  const fvPatch& p,
60  const dictionary& dict
61 )
62 :
63  fixedValueFvPatchField<Type>(p, iF, dict, false),
64  uniformValue_(Function1<Type>::New("uniformValue", dict))
65 {
66  this->evaluate();
67 }
68 
69 
70 template<class Type>
72 (
74  const fvPatch& p,
76  const fvPatchFieldMapper& mapper
77 )
78 :
79  fixedValueFvPatchField<Type>(ptf, p, iF, mapper, false), // Don't map
80  uniformValue_(ptf.uniformValue_, false)
81 {
82  // Evaluate since value not mapped
83  this->evaluate();
84 }
85 
86 
87 template<class Type>
89 (
92 )
93 :
95  uniformValue_(ptf.uniformValue_, false)
96 {
97  // Evaluate the profile if defined
98  if (ptf.uniformValue_.valid())
99  {
100  this->evaluate();
101  }
102 }
103 
104 
105 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
106 
107 template<class Type>
109 {
110  if (this->updated())
111  {
112  return;
113  }
114 
115  const scalar t = this->db().time().timeOutputValue();
116  fvPatchField<Type>::operator==(uniformValue_->value(t));
117 
119 }
120 
121 
122 template<class Type>
124 {
126  writeEntry(os, uniformValue_());
127  writeEntry(os, "value", *this);
128 }
129 
130 
131 // ************************************************************************* //
Run-time selectable general function of one variable.
Definition: Function1.H:52
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
dictionary dict
void evaluate(GeometricField< Type, PatchField, GeoMesh > &result, const Function1< Type > &func, const GeometricField< Type, PatchField, GeoMesh > &x)
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:62
This boundary condition provides a uniform fixed value condition.
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))
Pre-declare SubField and related Field type.
Definition: Field.H:56
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
Foam::fvPatchFieldMapper.
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
uniformFixedValueFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
virtual void write(Ostream &) const
Write.
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
Definition: HashTableIO.C:96
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
volScalarField & p