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-2014 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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
29 
30 namespace Foam
31 {
32 
33 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
34 
35 template<class Type>
37 (
38  const fvPatch& p,
40 )
41 :
43 {}
44 
45 
46 template<class Type>
48 (
49  const fvPatch& p,
51  const dictionary& dict
52 )
53 :
54  fvPatchField<Type>(p, iF, dict, true)
55 {}
56 
57 
58 template<class Type>
60 (
62  const fvPatch& p,
64  const fvPatchFieldMapper& mapper
65 )
66 :
67  fvPatchField<Type>(ptf, p, iF, mapper)
68 {
69  if (notNull(iF) && mapper.hasUnmapped())
70  {
71  WarningIn
72  (
73  "fixedValueFvPatchField<Type>::fixedValueFvPatchField\n"
74  "(\n"
75  " const fixedValueFvPatchField<Type>&,\n"
76  " const fvPatch&,\n"
77  " const DimensionedField<Type, volMesh>&,\n"
78  " const fvPatchFieldMapper&\n"
79  ")\n"
80  ) << "On field " << iF.name() << " patch " << p.name()
81  << " patchField " << this->type()
82  << " : mapper does not map all values." << nl
83  << " To avoid this warning fully specify the mapping in derived"
84  << " patch fields." << endl;
85  }
86 }
87 
88 
89 template<class Type>
91 (
93 )
94 :
96 {}
97 
98 
99 template<class Type>
101 (
102  const fixedValueFvPatchField<Type>& ptf,
104 )
105 :
106  fvPatchField<Type>(ptf, iF)
107 {}
108 
109 
110 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
111 
112 template<class Type>
114 (
115  const tmp<scalarField>&
116 ) const
117 {
118  return tmp<Field<Type> >
119  (
120  new Field<Type>(this->size(), pTraits<Type>::zero)
121  );
122 }
123 
124 
125 template<class Type>
127 (
128  const tmp<scalarField>&
129 ) const
130 {
131  return *this;
132 }
133 
134 
135 template<class Type>
137 {
138  return -pTraits<Type>::one*this->patch().deltaCoeffs();
139 }
140 
141 
142 template<class Type>
144 {
145  return this->patch().deltaCoeffs()*(*this);
146 }
147 
148 
149 template<class Type>
151 {
153  this->writeEntry("value", os);
154 }
155 
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 } // End namespace Foam
160 
161 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the.
Foam::fvPatchFieldMapper.
bool notNull(const T &t)
Return true if t is not a reference to the nullObject of type T.
Definition: nullObjectI.H:46
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.
Definition: fvPatchField.C:354
Namespace for OpenFOAM.
virtual tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the.
dictionary dict
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the.
static const char nl
Definition: Ostream.H:260
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
#define WarningIn(functionName)
Report a warning using Foam::Warning.
volScalarField & p
Definition: createFields.H:51
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:65
Pre-declare SubField and related Field type.
Definition: Field.H:57
virtual tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the.
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
Definition: POSIX.C:589
Traits class for primitives.
Definition: pTraits.H:50
virtual void write(Ostream &) const
Write.
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...
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
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.
A class for managing temporary objects.
Definition: PtrList.H:118