1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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.
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
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/>.
25 Foam::directMappedFieldFvPatchField
28 Self-contained version of directMapped. Does not use information on
29 patch, instead holds it locally (and possibly duplicate) so use
30 normal directMapped in preference and only use this if you cannot
31 change the underlying patch type to directMapped.
34 directMappedFieldFvPatchField.C
36 \*---------------------------------------------------------------------------*/
38 #ifndef directMappedFieldFvPatchField_H
39 #define directMappedFieldFvPatchField_H
41 #include "directMappedPatchBase.H"
42 #include "fixedValueFvPatchFields.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 /*---------------------------------------------------------------------------*\
50 Class directMappedFieldFvPatchField Declaration
51 \*---------------------------------------------------------------------------*/
54 class directMappedFieldFvPatchField
56 public directMappedPatchBase,
57 public fixedValueFvPatchField<Type>
61 //- Name of field to sample - defaults to field associated with this
62 // patchField if not specified
65 //- If true adjust the mapped field to maintain average value average_
66 const bool setAverage_;
68 //- Average value the mapped field is adjusted to maintain if
69 // setAverage_ is set true
73 // Private Member Functions
75 //- Field to sample. Either on my or nbr mesh
76 const GeometricField<Type, fvPatchField, volMesh>& sampleField() const;
81 //- Runtime type information
82 TypeName("directMappedField");
87 //- Construct from patch and internal field
88 directMappedFieldFvPatchField
91 const DimensionedField<Type, volMesh>&
94 //- Construct from patch, internal field and dictionary
95 directMappedFieldFvPatchField
98 const DimensionedField<Type, volMesh>&,
102 //- Construct from patch, internal field and distance for normal type
104 directMappedFieldFvPatchField
107 const DimensionedField<Type, volMesh>&,
109 // directMappedPatchBase
110 const word& sampleRegion,
111 const sampleMode sampleMode,
112 const word& samplePatch,
113 const scalar distance,
116 const word& fieldName,
117 const bool setAverage,
121 //- Construct by mapping given
122 // directMappedFieldFvPatchField
124 directMappedFieldFvPatchField
126 const directMappedFieldFvPatchField<Type>&,
128 const DimensionedField<Type, volMesh>&,
129 const fvPatchFieldMapper&
132 //- Construct as copy
133 directMappedFieldFvPatchField
135 const directMappedFieldFvPatchField<Type>&
138 //- Construct and return a clone
139 virtual tmp<fvPatchField<Type> > clone() const
141 return tmp<fvPatchField<Type> >
143 new directMappedFieldFvPatchField<Type>
150 //- Construct as copy setting internal field reference
151 directMappedFieldFvPatchField
153 const directMappedFieldFvPatchField<Type>&,
154 const DimensionedField<Type, volMesh>&
157 //- Construct and return a clone setting internal field reference
158 virtual tmp<fvPatchField<Type> > clone
160 const DimensionedField<Type, volMesh>& iF
163 return tmp<fvPatchField<Type> >
165 new directMappedFieldFvPatchField<Type>
176 // Evaluation functions
178 //- Update the coefficients associated with the patch field
179 virtual void updateCoeffs();
183 virtual void write(Ostream&) const;
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 } // End namespace Foam
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 # include "directMappedFieldFvPatchField.C"
197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201 // ************************************************************************* //