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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2017 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::directionMixedFvPatchField
28 
29 Group
30  grpGenericBoundaryConditions
31 
32 Description
33  Base class for direction-mixed boundary conditions.
34 
35 SourceFiles
36  directionMixedFvPatchField.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef directionMixedFvPatchField_H
41 #define directionMixedFvPatchField_H
42 
43 #include "transformFvPatchField.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class directionMixedFvPatchField Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 template<class Type>
56 :
57  public transformFvPatchField<Type>
58 {
59  // Private data
60 
61  //- Value field
62  Field<Type> refValue_;
63 
64  //- Normal gradient field
65  Field<Type> refGrad_;
66 
67  //- Fraction (0-1) of value used for boundary condition
68  symmTensorField valueFraction_;
69 
70 
71 public:
72 
73  //- Runtime type information
74  TypeName("directionMixed");
75 
76 
77  // Constructors
78 
79  //- Construct from patch and internal field
81  (
82  const fvPatch&,
84  );
85 
86  //- Construct from patch, internal field and dictionary
88  (
89  const fvPatch&,
91  const dictionary&
92  );
93 
94  //- Construct by mapping given directionMixedFvPatchField onto
95  // a new patch
97  (
99  const fvPatch&,
101  const fvPatchFieldMapper&
102  );
103 
104  //- Construct and return a clone
105  virtual tmp<fvPatchField<Type>> clone() const
106  {
107  return tmp<fvPatchField<Type>>
108  (
110  );
111  }
112 
113  //- Construct as copy setting internal field reference
115  (
118  );
119 
120  //- Construct and return a clone setting internal field reference
122  (
124  ) const
125  {
126  return tmp<fvPatchField<Type>>
127  (
128  new directionMixedFvPatchField<Type>(*this, iF)
129  );
130  }
131 
132 
133  // Member Functions
134 
135  //- True: this patch field fixes a value.
136  virtual bool fixesValue() const { return true; }
137 
138  //- False: this patch field is not altered by assignment.
139  virtual bool assignable() const { return false; }
140 
141 
142  // Mapping functions
143 
144  //- Map (and resize as needed) from self given a mapping object
145  virtual void autoMap
146  (
147  const fvPatchFieldMapper&
148  );
149 
150  //- Reverse map the given fvPatchField onto this fvPatchField
151  virtual void rmap
152  (
153  const fvPatchField<Type>&,
154  const labelList&
155  );
156 
157 
158  // Return defining fields
160  virtual Field<Type>& refValue()
161  {
162  return refValue_;
163  }
164 
165  virtual const Field<Type>& refValue() const
166  {
167  return refValue_;
168  }
169 
170  virtual Field<Type>& refGrad()
171  {
172  return refGrad_;
173  }
174 
175  virtual const Field<Type>& refGrad() const
176  {
177  return refGrad_;
178  }
179 
180  virtual symmTensorField& valueFraction()
181  {
182  return valueFraction_;
183  }
185  virtual const symmTensorField& valueFraction() const
186  {
187  return valueFraction_;
188  }
190 
191  // Evaluation functions
192 
193  //- Return gradient at boundary
194  virtual tmp<Field<Type>> snGrad() const;
195 
196  //- Evaluate the patch field
197  virtual void evaluate
198  (
199  const Pstream::commsTypes commsType =
201  );
202 
203  //- Return face-gradient transform diagonal
205 
206 
207  //- Write
208  virtual void write(Ostream&) const;
210 
211  // Member operators
212 
213  virtual void operator=(const fvPatchField<Type>&) {}
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 
219  virtual void operator=(const Field<Type>&) {}
220  virtual void operator+=(const Field<Type>&) {}
221  virtual void operator-=(const Field<Type>&) {}
222  virtual void operator*=(const Field<scalar>&) {}
223  virtual void operator/=(const Field<scalar>&) {}
224 
225  virtual void operator=(const Type&) {}
226  virtual void operator+=(const Type&) {}
227  virtual void operator-=(const Type&) {}
228  virtual void operator*=(const scalar) {}
229  virtual void operator/=(const scalar) {}
230 };
231 
232 
233 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
234 
235 } // End namespace Foam
236 
237 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
238 
239 #ifdef NoRepository
241 #endif
242 
243 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
244 
245 #endif
247 // ************************************************************************* //
directionMixedFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
"blocking" : (MPI_Bsend, MPI_Recv)
Field< symmTensor > symmTensorField
Specialisation of Field<T> for symmTensor.
commsTypes
Communications types.
Definition: UPstream.H:72
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
virtual void write(Ostream &) const
Write.
TypeName("directionMixed")
Runtime type information.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
virtual void operator*=(const fvPatchField< Type > &)
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Base class for direction-mixed boundary conditions.
virtual tmp< Field< Type > > snGrad() const
Return gradient at boundary.
Generic templated field type.
Definition: Field.H:62
A FieldMapper for finite-volume patch fields.
virtual void operator-=(const fvPatchField< Type > &)
virtual bool fixesValue() const
True: this patch field fixes a value.
virtual void operator+=(const fvPatchField< Type > &)
virtual void operator=(const fvPatchField< Type > &)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
Foam::transformFvPatchField.
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
virtual void operator/=(const fvPatchField< Type > &)
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
Evaluate the patch field.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: areaFieldsFwd.H:42
virtual bool assignable() const
False: this patch field is not altered by assignment.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
virtual symmTensorField & valueFraction()
virtual tmp< Field< Type > > snGradTransformDiag() const
Return face-gradient transform diagonal.
Namespace for OpenFOAM.