FreeFOAM The Cross-Platform CFD Toolkit
directMappedFixedValueFvPatchField.H
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) 1991-2010 OpenCFD Ltd.
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 Class
25  Foam::directMappedFixedValueFvPatchField
26 
27 Description
28  Recycles the value at a set of cells or patch faces back to *this. Can not
29  sample internal faces (since volField not defined on faces).
30 
31  mode = NEARESTCELL : sample nearest cell
32  mode = NEARESTPATCHFACE : sample nearest face on selected patch
33  mode = NEARESTFACE : sample nearest face on any patch. Note: does not
34  warn if nearest actually is on internal face!
35 
36 SourceFiles
37  directMappedFixedValueFvPatchField.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef directMappedFixedValueFvPatchField_H
42 #define directMappedFixedValueFvPatchField_H
43 
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 /*---------------------------------------------------------------------------*\
53  Class directMappedFixedValueFvPatch Declaration
54 \*---------------------------------------------------------------------------*/
55 
56 template<class Type>
58 :
59  public fixedValueFvPatchField<Type>
60 {
61  // Private data
62 
63  //- If true adjust the mapped field to maintain average value average_
64  bool setAverage_;
65 
66  //- Average value the mapped field is adjusted to maintain if
67  // setAverage_ is set true
68  Type average_;
69 
70 public:
71 
72  //- Runtime type information
73  TypeName("directMapped");
74 
75 
76  // Constructors
77 
78  //- Construct from patch and internal field
80  (
81  const fvPatch&,
83  );
84 
85  //- Construct from patch, internal field and dictionary
87  (
88  const fvPatch&,
90  const dictionary&
91  );
92 
93  //- Construct by mapping given directMappedFixedValueFvPatchField
94  // onto a new patch
96  (
98  const fvPatch&,
100  const fvPatchFieldMapper&
101  );
102 
103  //- Construct as copy
105  (
107  );
108 
109  //- Construct and return a clone
110  virtual tmp<fvPatchField<Type> > clone() const
111  {
112  return tmp<fvPatchField<Type> >
113  (
115  );
116  }
117 
118  //- Construct as copy setting internal field reference
120  (
123  );
124 
125  //- Construct and return a clone setting internal field reference
126  virtual tmp<fvPatchField<Type> > clone
127  (
129  ) const
130  {
131  return tmp<fvPatchField<Type> >
132  (
134  );
135  }
136 
137 
138  // Member functions
139 
140  // Evaluation functions
141 
142  //- Update the coefficients associated with the patch field
143  virtual void updateCoeffs();
144 
145  //- Write
146  virtual void write(Ostream&) const;
147 };
148 
149 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
152 } // End namespace Foam
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 #ifdef NoRepository
158 #endif
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 #endif
163 
164 // ************************ vim: set sw=4 sts=4 et: ************************ //