emptyFvPatchField.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-2016 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::emptyFvPatchField
26 
27 Group
28  grpConstraintBoundaryConditions
29 
30 Description
31  This boundary condition provides an 'empty' condition for reduced
32  dimensions cases, i.e. 1- and 2-D geometries. Apply this condition to
33  patches whose normal is aligned to geometric directions that do not
34  constitue solution directions.
35 
36 Usage
37  Example of the boundary condition specification:
38  \verbatim
39  <patchName>
40  {
41  type empty;
42  }
43  \endverbatim
44 
45 SourceFiles
46  emptyFvPatchField.C
47 
48 \*---------------------------------------------------------------------------*/
49 
50 #ifndef emptyFvPatchField_H
51 #define emptyFvPatchField_H
52 
53 #include "fvPatchField.H"
54 #include "emptyFvPatch.H"
55 
56 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57 
58 namespace Foam
59 {
60 
61 /*---------------------------------------------------------------------------*\
62  Class emptyFvPatchField Declaration
63 \*---------------------------------------------------------------------------*/
64 
65 template<class Type>
66 class emptyFvPatchField
67 :
68  public fvPatchField<Type>
69 {
70 
71 public:
72 
73  //- Runtime type information
74  TypeName(emptyFvPatch::typeName_());
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 emptyFvPatchField 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  (
114  new emptyFvPatchField<Type>(*this)
115  );
116  }
117 
118  //- Construct as copy setting internal field reference
120  (
123  );
124 
125  //- Construct and return a clone setting internal field reference
127  (
129  ) const
130  {
131  return tmp<fvPatchField<Type>>
132  (
133  new emptyFvPatchField<Type>(*this, iF)
134  );
135  }
136 
137 
138  // Member functions
139 
140  // Mapping functions
141 
142  //- Map (and resize as needed) from self given a mapping object
143  virtual void autoMap
144  (
145  const fvPatchFieldMapper&
146  )
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 
158  // Evaluation functions
159 
160  //- Update the coefficients associated with the patch field
161  // This only checks to see the case is actually 1D or 2D
162  // for which this boundary condition is valid
163  void updateCoeffs();
164 
165 
166  //- Return the matrix diagonal coefficients corresponding to the
167  // evaluation of the value of this patchField with given weights
169  (
170  const tmp<scalarField>&
171  ) const
172  {
173  return tmp<Field<Type>>(new Field<Type>(0));
174  }
175 
176  //- Return the matrix source coefficients corresponding to the
177  // evaluation of the value of this patchField with given weights
179  (
180  const tmp<scalarField>&
181  ) const
182  {
183  return tmp<Field<Type>>(new Field<Type>(0));
184  }
185 
186  //- Return the matrix diagonal coefficients corresponding to the
187  // evaluation of the gradient of this patchField
189  {
190  return tmp<Field<Type>>(new Field<Type>(0));
191  }
192 
193  //- Return the matrix source coefficients corresponding to the
194  // evaluation of the gradient of this patchField
196  {
197  return tmp<Field<Type>>(new Field<Type>(0));
198  }
199 };
200 
201 
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 
204 } // End namespace Foam
205 
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 
208 #ifdef NoRepository
209  #include "emptyFvPatchField.C"
210 #endif
211 
212 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
213 
214 #endif
215 
216 // ************************************************************************* //
TypeName(emptyFvPatch::typeName_())
Runtime type information.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
void updateCoeffs()
Update the coefficients associated with the patch field.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the.
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:65
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Pre-declare SubField and related Field type.
Definition: Field.H:57
emptyFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Foam::fvPatchFieldMapper.
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
This boundary condition provides an &#39;empty&#39; condition for reduced dimensions cases, i.e. 1- and 2-D geometries. Apply this condition to patches whose normal is aligned to geometric directions that do not constitue solution directions.
A class for managing temporary objects.
Definition: PtrList.H:54
tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the.
Namespace for OpenFOAM.