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) 2011-2012 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 Class
25  Foam::directionMixedFvPatchField
26 
27 Group
28  grpGenericBoundaryConditions
29 
30 Description
31  Base class for direction-mixed boundary conditions.
32 
33 SourceFiles
34  directionMixedFvPatchField.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef directionMixedFvPatchField_H
39 #define directionMixedFvPatchField_H
40 
41 #include "transformFvPatchField.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class directionMixedFvPatchField Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 template<class Type>
54 :
55  public transformFvPatchField<Type>
56 {
57  // Private data
58 
59  //- Value field
61 
62  //- Normal gradient field
64 
65  //- Fraction (0-1) of value used for boundary condition
67 
68 
69 public:
70 
71  //- Runtime type information
72  TypeName("directionMixed");
73 
74 
75  // Constructors
76 
77  //- Construct from patch and internal field
79  (
80  const fvPatch&,
82  );
83 
84  //- Construct from patch, internal field and dictionary
86  (
87  const fvPatch&,
89  const dictionary&
90  );
91 
92  //- Construct by mapping given directionMixedFvPatchField onto
93  // a new patch
95  (
97  const fvPatch&,
99  const fvPatchFieldMapper&
100  );
101 
102  //- Construct and return a clone
103  virtual tmp<fvPatchField<Type> > clone() const
104  {
105  return tmp<fvPatchField<Type> >
106  (
108  );
109  }
110 
111  //- Construct as copy setting internal field reference
113  (
116  );
117 
118  //- Construct and return a clone setting internal field reference
120  (
122  ) const
123  {
124  return tmp<fvPatchField<Type> >
125  (
126  new directionMixedFvPatchField<Type>(*this, iF)
127  );
128  }
129 
130 
131  // Member functions
132 
133  // Access
134 
135  //- Return true if this patch field fixes a value.
136  // Needed to check if a level has to be specified while solving
137  // Poissons equations.
138  virtual bool fixesValue() const
139  {
140  return true;
141  }
142 
143 
144  // Mapping functions
145 
146  //- Map (and resize as needed) from self given a mapping object
147  virtual void autoMap
148  (
149  const fvPatchFieldMapper&
150  );
151 
152  //- Reverse map the given fvPatchField onto this fvPatchField
153  virtual void rmap
154  (
155  const fvPatchField<Type>&,
156  const labelList&
157  );
158 
159 
160  // Return defining fields
161 
162  virtual Field<Type>& refValue()
163  {
164  return refValue_;
165  }
166 
167  virtual const Field<Type>& refValue() const
168  {
169  return refValue_;
170  }
171 
172  virtual Field<Type>& refGrad()
173  {
174  return refGrad_;
175  }
176 
177  virtual const Field<Type>& refGrad() const
178  {
179  return refGrad_;
180  }
181 
182  virtual symmTensorField& valueFraction()
183  {
184  return valueFraction_;
185  }
186 
187  virtual const symmTensorField& valueFraction() const
188  {
189  return valueFraction_;
190  }
191 
192 
193  // Evaluation functions
194 
195  //- Return gradient at boundary
196  virtual tmp<Field<Type> > snGrad() const;
197 
198  //- Evaluate the patch field
199  virtual void evaluate
200  (
201  const Pstream::commsTypes commsType=Pstream::blocking
202  );
203 
204  //- Return face-gradient transform diagonal
205  virtual tmp<Field<Type> > snGradTransformDiag() const;
206 
207 
208  //- Write
209  virtual void write(Ostream&) const;
210 
211 
212  // Member operators
213 
214  virtual void operator=(const fvPatchField<Type>&) {}
215  virtual void operator+=(const fvPatchField<Type>&) {}
216  virtual void operator-=(const fvPatchField<Type>&) {}
217  virtual void operator*=(const fvPatchField<Type>&) {}
218  virtual void operator/=(const fvPatchField<Type>&) {}
219 
220  virtual void operator=(const Field<Type>&) {}
221  virtual void operator+=(const Field<Type>&) {}
222  virtual void operator-=(const Field<Type>&) {}
223  virtual void operator*=(const Field<scalar>&) {}
224  virtual void operator/=(const Field<scalar>&) {}
225 
226  virtual void operator=(const Type&) {}
227  virtual void operator+=(const Type&) {}
228  virtual void operator-=(const Type&) {}
229  virtual void operator*=(const scalar) {}
230  virtual void operator/=(const scalar) {}
231 };
232 
233 
234 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
235 
236 } // End namespace Foam
237 
238 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
239 
240 #ifdef NoRepository
242 #endif
243 
244 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
245 
246 #endif
247 
248 // ************************************************************************* //
Foam::fvPatchField< Type >
Foam::directionMixedFvPatchField::operator*=
virtual void operator*=(const fvPatchField< Type > &)
Definition: directionMixedFvPatchField.H:216
Foam::labelList
List< label > labelList
A List of labels.
Definition: labelList.H:56
directionMixedFvPatchField.C
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::directionMixedFvPatchField::operator=
virtual void operator=(const fvPatchField< Type > &)
Definition: directionMixedFvPatchField.H:213
Foam::directionMixedFvPatchField::rmap
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: directionMixedFvPatchField.C:119
Foam::directionMixedFvPatchField::evaluate
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::blocking)
Evaluate the patch field.
Definition: directionMixedFvPatchField.C:155
Foam::directionMixedFvPatchField::operator/=
virtual void operator/=(const fvPatchField< Type > &)
Definition: directionMixedFvPatchField.H:217
Foam::directionMixedFvPatchField::operator-=
virtual void operator-=(const fvPatchField< Type > &)
Definition: directionMixedFvPatchField.H:215
Foam::directionMixedFvPatchField::snGrad
virtual tmp< Field< Type > > snGrad() const
Return gradient at boundary.
Definition: directionMixedFvPatchField.C:137
Foam::directionMixedFvPatchField::operator=
virtual void operator=(const Type &)
Definition: directionMixedFvPatchField.H:225
Foam::directionMixedFvPatchField::refValue
virtual const Field< Type > & refValue() const
Definition: directionMixedFvPatchField.H:166
Foam::directionMixedFvPatchField::operator+=
virtual void operator+=(const Type &)
Definition: directionMixedFvPatchField.H:226
Foam::directionMixedFvPatchField::valueFraction
virtual const symmTensorField & valueFraction() const
Definition: directionMixedFvPatchField.H:186
Foam::directionMixedFvPatchField::write
virtual void write(Ostream &) const
Write.
Definition: directionMixedFvPatchField.C:203
Foam::directionMixedFvPatchField::clone
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Definition: directionMixedFvPatchField.H:102
Foam::directionMixedFvPatchField::snGradTransformDiag
virtual tmp< Field< Type > > snGradTransformDiag() const
Return face-gradient transform diagonal.
Definition: directionMixedFvPatchField.C:178
Foam::directionMixedFvPatchField::refGrad
virtual Field< Type > & refGrad()
Definition: directionMixedFvPatchField.H:171
Foam::directionMixedFvPatchField::TypeName
TypeName("directionMixed")
Runtime type information.
Foam::UPstream::blocking
@ blocking
Definition: UPstream.H:66
Foam::directionMixedFvPatchField::operator*=
virtual void operator*=(const Field< scalar > &)
Definition: directionMixedFvPatchField.H:222
Foam::directionMixedFvPatchField::operator=
virtual void operator=(const Field< Type > &)
Definition: directionMixedFvPatchField.H:219
Foam::Field< Type >
Foam::directionMixedFvPatchField::refValue_
Field< Type > refValue_
Value field.
Definition: directionMixedFvPatchField.H:59
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::directionMixedFvPatchField::directionMixedFvPatchField
directionMixedFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Definition: directionMixedFvPatchField.C:33
Foam::directionMixedFvPatchField::valueFraction_
symmTensorField valueFraction_
Fraction (0-1) of value used for boundary condition.
Definition: directionMixedFvPatchField.H:65
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::directionMixedFvPatchField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: directionMixedFvPatchField.C:106
Foam::directionMixedFvPatchField::operator*=
virtual void operator*=(const scalar)
Definition: directionMixedFvPatchField.H:228
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:64
Foam::directionMixedFvPatchField::operator-=
virtual void operator-=(const Type &)
Definition: directionMixedFvPatchField.H:227
Foam::directionMixedFvPatchField::valueFraction
virtual symmTensorField & valueFraction()
Definition: directionMixedFvPatchField.H:181
Foam::directionMixedFvPatchField::refValue
virtual Field< Type > & refValue()
Definition: directionMixedFvPatchField.H:161
Foam::directionMixedFvPatchField::operator/=
virtual void operator/=(const Field< scalar > &)
Definition: directionMixedFvPatchField.H:223
transformFvPatchField.H
Foam::directionMixedFvPatchField::refGrad
virtual const Field< Type > & refGrad() const
Definition: directionMixedFvPatchField.H:176
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::directionMixedFvPatchField::fixesValue
virtual bool fixesValue() const
Return true if this patch field fixes a value.
Definition: directionMixedFvPatchField.H:137
Foam::transformFvPatchField
Foam::transformFvPatchField.
Definition: transformFvPatchField.H:52
Foam::directionMixedFvPatchField::operator+=
virtual void operator+=(const Field< Type > &)
Definition: directionMixedFvPatchField.H:220
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:45
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::directionMixedFvPatchField::operator-=
virtual void operator-=(const Field< Type > &)
Definition: directionMixedFvPatchField.H:221
Foam::directionMixedFvPatchField::operator+=
virtual void operator+=(const fvPatchField< Type > &)
Definition: directionMixedFvPatchField.H:214
Foam::directionMixedFvPatchField
Base class for direction-mixed boundary conditions.
Definition: directionMixedFvPatchField.H:52
Foam::directionMixedFvPatchField::operator/=
virtual void operator/=(const scalar)
Definition: directionMixedFvPatchField.H:229
Foam::directionMixedFvPatchField::refGrad_
Field< Type > refGrad_
Normal gradient field.
Definition: directionMixedFvPatchField.H:62
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51