fixedValueFvPatchField.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-2016 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 
26 #include "fixedValueFvPatchField.H"
27 
28 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
29 
30 template<class Type>
32 (
33  const fvPatch& p,
35 )
36 :
38 {}
39 
40 
41 template<class Type>
43 (
44  const fvPatch& p,
46  const Type& value
47 )
48 :
49  fvPatchField<Type>(p, iF, value)
50 {}
51 
52 
53 template<class Type>
55 (
56  const fvPatch& p,
58  const dictionary& dict
59 )
60 :
61  fvPatchField<Type>(p, iF, dict, true)
62 {}
63 
64 
65 template<class Type>
67 (
69  const fvPatch& p,
71  const fvPatchFieldMapper& mapper
72 )
73 :
74  fvPatchField<Type>(ptf, p, iF, mapper)
75 {
76  if (notNull(iF) && mapper.hasUnmapped())
77  {
79  << "On field " << iF.name() << " patch " << p.name()
80  << " patchField " << this->type()
81  << " : mapper does not map all values." << nl
82  << " To avoid this warning fully specify the mapping in derived"
83  << " patch fields." << endl;
84  }
85 }
86 
87 
88 template<class Type>
90 (
92 )
93 :
95 {}
96 
97 
98 template<class Type>
100 (
101  const fixedValueFvPatchField<Type>& ptf,
103 )
104 :
105  fvPatchField<Type>(ptf, iF)
106 {}
107 
108 
109 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
110 
111 template<class Type>
114 (
115  const tmp<scalarField>&
116 ) const
117 {
118  return tmp<Field<Type>>
119  (
120  new Field<Type>(this->size(), Zero)
121  );
122 }
123 
124 
125 template<class Type>
128 (
129  const tmp<scalarField>&
130 ) const
131 {
132  return *this;
133 }
134 
135 
136 template<class Type>
139 {
140  return -pTraits<Type>::one*this->patch().deltaCoeffs();
141 }
142 
143 
144 template<class Type>
147 {
148  return this->patch().deltaCoeffs()*(*this);
149 }
150 
151 
152 template<class Type>
154 {
156  this->writeEntry("value", os);
157 }
158 
159 
160 // ************************************************************************* //
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
dictionary dict
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
virtual void write(Ostream &) const
Write.
virtual tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:253
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Traits class for primitives.
Definition: pTraits.H:50
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:65
virtual tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the.
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the.
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::fvPatchFieldMapper.
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the.
static const zero Zero
Definition: zero.H:91
virtual bool hasUnmapped() const =0
Are there unmapped values? I.e. do all size() elements get.
fixedValueFvPatchField(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:53
static const char nl
Definition: Ostream.H:262
bool notNull(const T &t)
Return true if t is not a reference to the nullObject of type T.
Definition: nullObjectI.H:46
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
Definition: POSIX.C:461
#define WarningInFunction
Report a warning using Foam::Warning.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
volScalarField & p
A class for managing temporary objects.
Definition: PtrList.H:54
runTime write()