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 as copy setting internal field reference
106  (
109  );
110 
111  //- Return a clone
112  virtual tmp<fvPatchField<Type>> clone() const
113  {
114  return fvPatchField<Type>::Clone(*this);
115  }
116 
117  //- Clone with an internal field reference
119  (
121  ) const
122  {
123  return fvPatchField<Type>::Clone(*this, iF);
124  }
125 
127  // Member Functions
128 
129  //- True: this patch field fixes a value.
130  virtual bool fixesValue() const { return true; }
131 
132  //- False: this patch field is not altered by assignment.
133  virtual bool assignable() const { return false; }
134 
136  // Mapping functions
137 
138  //- Map (and resize as needed) from self given a mapping object
139  virtual void autoMap
140  (
141  const fvPatchFieldMapper&
142  );
143 
144  //- Reverse map the given fvPatchField onto this fvPatchField
145  virtual void rmap
146  (
147  const fvPatchField<Type>&,
148  const labelList&
149  );
150 
151 
152  // Return defining fields
154  virtual Field<Type>& refValue()
155  {
156  return refValue_;
157  }
158 
159  virtual const Field<Type>& refValue() const
160  {
161  return refValue_;
162  }
163 
164  virtual Field<Type>& refGrad()
165  {
166  return refGrad_;
167  }
168 
169  virtual const Field<Type>& refGrad() const
170  {
171  return refGrad_;
172  }
173 
174  virtual symmTensorField& valueFraction()
175  {
176  return valueFraction_;
177  }
179  virtual const symmTensorField& valueFraction() const
180  {
181  return valueFraction_;
182  }
184 
185  // Evaluation functions
186 
187  //- Return gradient at boundary
188  virtual tmp<Field<Type>> snGrad() const;
189 
190  //- Evaluate the patch field
191  virtual void evaluate
192  (
193  const Pstream::commsTypes commsType =
195  );
196 
197  //- Return face-gradient transform diagonal
199 
200 
201  //- Write
202  virtual void write(Ostream&) const;
204 
205  // Member operators
206 
207  virtual void operator=(const fvPatchField<Type>&) {}
208  virtual void operator+=(const fvPatchField<Type>&) {}
209  virtual void operator-=(const fvPatchField<Type>&) {}
210  virtual void operator*=(const fvPatchField<Type>&) {}
211  virtual void operator/=(const fvPatchField<Type>&) {}
212 
213  virtual void operator=(const Field<Type>&) {}
214  virtual void operator+=(const Field<Type>&) {}
215  virtual void operator-=(const Field<Type>&) {}
216  virtual void operator*=(const Field<scalar>&) {}
217  virtual void operator/=(const Field<scalar>&) {}
218 
219  virtual void operator=(const Type&) {}
220  virtual void operator+=(const Type&) {}
221  virtual void operator-=(const Type&) {}
222  virtual void operator*=(const scalar) {}
223  virtual void operator/=(const scalar) {}
224 };
225 
226 
227 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
228 
229 } // End namespace Foam
230 
231 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
232 
233 #ifdef NoRepository
235 #endif
236 
237 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
238 
239 #endif
241 // ************************************************************************* //
directionMixedFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::buffered)
Evaluate the patch field.
Field< symmTensor > symmTensorField
Specialisation of Field<T> for symmTensor.
commsTypes
Communications types.
Definition: UPstream.H:77
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.
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
Definition: fvPatchField.H:597
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
Intermediate layer (not used directly as a user boundary condition). The "value" entry is NO_READ...
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
Return a clone.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
virtual bool assignable() const
False: this patch field is not altered by assignment.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
"buffered" : (MPI_Bsend, MPI_Recv)
virtual symmTensorField & valueFraction()
virtual tmp< Field< Type > > snGradTransformDiag() const
Return face-gradient transform diagonal.
Namespace for OpenFOAM.