FreeFOAM The Cross-Platform CFD Toolkit
directionMixedFvPatchField.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::directionMixedFvPatchField
26 
27 Description
28  Foam::directionMixedFvPatchField
29 
30 SourceFiles
31  directionMixedFvPatchField.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef directionMixedFvPatchField_H
36 #define directionMixedFvPatchField_H
37 
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class directionMixedFvPatch Declaration
47 \*---------------------------------------------------------------------------*/
48 
49 template<class Type>
51 :
52  public transformFvPatchField<Type>
53 {
54  // Private data
55 
56  //- Value field
57  Field<Type> refValue_;
58 
59  //- Normal gradient field
60  Field<Type> refGrad_;
61 
62  //- Fraction (0-1) of value used for boundary condition
63  symmTensorField valueFraction_;
64 
65 
66 public:
67 
68  //- Runtime type information
69  TypeName("directionMixed");
70 
71 
72  // Constructors
73 
74  //- Construct from patch and internal field
76  (
77  const fvPatch&,
79  );
80 
81  //- Construct from patch, internal field and dictionary
83  (
84  const fvPatch&,
86  const dictionary&
87  );
88 
89  //- Construct by mapping given directionMixedFvPatchField onto
90  // a new patch
92  (
94  const fvPatch&,
96  const fvPatchFieldMapper&
97  );
98 
99  //- Construct and return a clone
100  virtual tmp<fvPatchField<Type> > clone() const
101  {
102  return tmp<fvPatchField<Type> >
103  (
105  );
106  }
107 
108  //- Construct as copy setting internal field reference
110  (
113  );
114 
115  //- Construct and return a clone setting internal field reference
116  virtual tmp<fvPatchField<Type> > clone
117  (
119  ) const
120  {
121  return tmp<fvPatchField<Type> >
122  (
123  new directionMixedFvPatchField<Type>(*this, iF)
124  );
125  }
126 
127 
128  // Member functions
129 
130  // Access
131 
132  //- Return true if this patch field fixes a value.
133  // Needed to check if a level has to be specified while solving
134  // Poissons equations.
135  virtual bool fixesValue() const
136  {
137  return true;
138  }
139 
140 
141  // Mapping functions
142 
143  //- Map (and resize as needed) from self given a mapping object
144  virtual void autoMap
145  (
146  const fvPatchFieldMapper&
147  );
148 
149  //- Reverse map the given fvPatchField onto this fvPatchField
150  virtual void rmap
151  (
152  const fvPatchField<Type>&,
153  const labelList&
154  );
155 
156 
157  // Return defining fields
158 
160  {
161  return refValue_;
162  }
163 
164  virtual const Field<Type>& refValue() const
165  {
166  return refValue_;
167  }
168 
169  virtual Field<Type>& refGrad()
170  {
171  return refGrad_;
172  }
173 
174  virtual const Field<Type>& refGrad() const
175  {
176  return refGrad_;
177  }
178 
180  {
181  return valueFraction_;
182  }
183 
184  virtual const symmTensorField& valueFraction() const
185  {
186  return valueFraction_;
187  }
188 
189 
190  // Evaluation functions
191 
192  //- Return gradient at boundary
193  virtual tmp<Field<Type> > snGrad() const;
194 
195  //- Evaluate the patch field
196  virtual void evaluate
197  (
198  const Pstream::commsTypes commsType=Pstream::blocking
199  );
200 
201  //- Return face-gradient transform diagonal
202  virtual tmp<Field<Type> > snGradTransformDiag() const;
203 
204 
205  //- Write
206  virtual void write(Ostream&) const;
207 
208 
209  // Member operators
210 
211  virtual void operator=(const fvPatchField<Type>&) {}
212  virtual void operator+=(const fvPatchField<Type>&) {}
213  virtual void operator-=(const fvPatchField<Type>&) {}
214  virtual void operator*=(const fvPatchField<Type>&) {}
215  virtual void operator/=(const fvPatchField<Type>&) {}
216 
217  virtual void operator=(const Field<Type>&) {}
218  virtual void operator+=(const Field<Type>&) {}
219  virtual void operator-=(const Field<Type>&) {}
220  virtual void operator*=(const Field<scalar>&) {}
221  virtual void operator/=(const Field<scalar>&) {}
222 
223  virtual void operator=(const Type&) {}
224  virtual void operator+=(const Type&) {}
225  virtual void operator-=(const Type&) {}
226  virtual void operator*=(const scalar) {}
227  virtual void operator/=(const scalar) {}
228 };
229 
230 
231 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
232 
233 } // End namespace Foam
234 
235 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
236 
237 #ifdef NoRepository
239 #endif
240 
241 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
242 
243 #endif
244 
245 // ************************ vim: set sw=4 sts=4 et: ************************ //