timeVaryingMappedFixedValueFvPatchField.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-2019 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 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
30 
31 template<class Type>
34 (
35  const fvPatch& p,
37 )
38 :
40  fieldMapper_(p, iF.name())
41 {}
42 
43 
44 template<class Type>
47 (
48  const fvPatch& p,
50  const dictionary& dict
51 )
52 :
53  fixedValueFvPatchField<Type>(p, iF, dict, false),
54  fieldMapper_(p, dict, iF.name())
55 {
56  if (dict.found("value"))
57  {
58  fvPatchField<Type>::operator==(Field<Type>("value", dict, p.size()));
59  }
60  else
61  {
62  // Note: we use evaluate() here to trigger updateCoeffs followed
63  // by re-setting of fvatchfield::updated_ flag. This is
64  // so if first use is in the next time step it retriggers
65  // a new update.
66  this->evaluate(Pstream::commsTypes::blocking);
67  }
68 }
69 
70 
71 template<class Type>
74 (
76  const fvPatch& p,
78  const fvPatchFieldMapper& mapper
79 )
80 :
81  fixedValueFvPatchField<Type>(ptf, p, iF, mapper),
82  fieldMapper_(ptf.fieldMapper_)
83 {}
84 
85 
86 template<class Type>
89 (
91 )
92 :
94  fieldMapper_(ptf.fieldMapper_)
95 {}
96 
97 
98 template<class Type>
101 (
104 )
105 :
107  fieldMapper_(ptf.fieldMapper_)
108 {}
109 
110 
111 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
112 
113 template<class Type>
115 (
116  const fvPatchFieldMapper& m
117 )
118 {
120  fieldMapper_.autoMap(m);
121 }
122 
123 
124 template<class Type>
126 (
127  const fvPatchField<Type>& ptf,
128  const labelList& addr
129 )
130 {
132  fieldMapper_.rmap
133  (
134  refCast
135  <
137  >(ptf).fieldMapper_,
138  addr
139  );
140 }
141 
142 
143 template<class Type>
145 {
146  if (this->updated())
147  {
148  return;
149  }
150 
151  this->operator==(fieldMapper_.map());
152 
154 }
155 
156 
157 template<class Type>
159 (
160  Ostream& os
161 ) const
162 {
164  fieldMapper_.write(os);
165  writeEntry(os, "value", *this);
166 }
167 
168 
169 // ************************************************************************* //
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
dictionary dict
const word & name() const
Return name.
Definition: IOobject.H:295
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
To & refCast(From &r)
Reference type cast template function.
Definition: typeInfo.H:106
void size(const label)
Override size to be inconsistent with allocated storage.
Definition: ListI.H:163
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:66
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
void write(Ostream &, const label, const dictionary &)
Write with dictionary lookup.
This boundary conditions interpolates the values from a set of supplied points in space and time...
Pre-declare SubField and related Field type.
Definition: Field.H:56
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
Foam::fvPatchFieldMapper.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
Definition: HashTableIO.C:96
timeVaryingMappedFixedValueFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
volScalarField & p