zeroGradientFaPatchField.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) 2016-2017 Wikki Ltd
9  Copyright (C) 2019 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::zeroGradientFaPatchField
29 
30 Description
31 
32 Author
33  Zeljko Tukovic, FMENA
34  Hrvoje Jasak, Wikki Ltd.
35 
36 SourceFiles
37  zeroGradientFaPatchField.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef zeroGradientFaPatchField_H
42 #define zeroGradientFaPatchField_H
43 
44 #include "faPatchField.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 /*---------------------------------------------------------------------------*\
52  Class zeroGradientFaPatchField Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 template<class Type>
57 :
58  public faPatchField<Type>
59 {
60 
61 public:
62 
63  //- Runtime type information
64  TypeName("zeroGradient");
65 
66 
67  // Constructors
68 
69  //- Construct from patch and internal field
71  (
72  const faPatch&,
74  );
75 
76  //- Construct from patch, internal field and dictionary
78  (
79  const faPatch&,
81  const dictionary&
82  );
83 
84  //- Construct by mapping the given zeroGradientFaPatchField<Type>
85  // onto a new patch
87  (
89  const faPatch&,
91  const faPatchFieldMapper&
92  );
93 
94  //- Construct as copy
96  (
98  );
99 
100  //- Construct and return a clone
101  virtual tmp<faPatchField<Type>> clone() const
102  {
103  return tmp<faPatchField<Type>>
104  (
106  );
107  }
108 
109  //- Construct as copy setting internal field reference
111  (
114  );
115 
116  //- Construct and return a clone setting internal field reference
118  (
120  ) const
121  {
122  return tmp<faPatchField<Type>>
123  (
124  new zeroGradientFaPatchField<Type>(*this, iF)
125  );
126  }
127 
128 
129  //- Destructor
130  virtual ~zeroGradientFaPatchField<Type>() = default;
131 
132 
133  // Member functions
134 
135  // Evaluation functions
136 
137  //- Return gradient at boundary
138  virtual tmp<Field<Type>> snGrad() const
139  {
140  return tmp<Field<Type>>
141  (
142  new Field<Type>(this->size(), Zero)
143  );
144  }
145 
146  //- Evaluate the patch field
147  virtual void evaluate
148  (
150  );
151 
152  //- Return the matrix diagonal coefficients corresponding to the
153  // evaluation of the value of this patchField with given weights
155  (
156  const tmp<scalarField>&
157  ) const;
158 
159  //- Return the matrix source coefficients corresponding to the
160  // evaluation of the value of this patchField with given weights
162  (
163  const tmp<scalarField>&
164  ) const;
165 
166  //- Return the matrix diagonal coefficients corresponding to the
167  // evaluation of the gradient of this patchField
168  virtual tmp<Field<Type>> gradientInternalCoeffs() const;
169 
170  //- Return the matrix source coefficients corresponding to the
171  // evaluation of the gradient of this patchField
172  virtual tmp<Field<Type>> gradientBoundaryCoeffs() const;
173 };
174 
175 
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 
178 } // End namespace Foam
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 #ifdef NoRepository
183  #include "zeroGradientFaPatchField.C"
184 #endif
185 
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 
188 #endif
189 
190 // ************************************************************************* //
Foam::zeroGradientFaPatchField::clone
virtual tmp< faPatchField< Type > > clone() const
Construct and return a clone.
Definition: zeroGradientFaPatchField.H:100
Foam::zeroGradientFaPatchField
Author Zeljko Tukovic, FMENA Hrvoje Jasak, Wikki Ltd.
Definition: zeroGradientFaPatchField.H:55
Foam::faPatchField
faPatchField<Type> abstract base class. This class gives a fat-interface to all derived classes cover...
Definition: areaFieldsFwd.H:50
zeroGradientFaPatchField.C
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::Zero
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
Foam::zeroGradientFaPatchField::TypeName
TypeName("zeroGradient")
Runtime type information.
faPatchField.H
Foam::faPatchFieldMapper
Definition: faPatchFieldMapper.H:44
Foam::zeroGradientFaPatchField::valueInternalCoeffs
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the.
Definition: zeroGradientFaPatchField.C:110
Foam::Field
Generic templated field type.
Definition: Field.H:63
Foam::zeroGradientFaPatchField::zeroGradientFaPatchField
zeroGradientFaPatchField(const faPatch &, const DimensionedField< Type, areaMesh > &)
Construct from patch and internal field.
Definition: zeroGradientFaPatchField.C:35
Foam::zeroGradientFaPatchField::gradientInternalCoeffs
virtual tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the.
Definition: zeroGradientFaPatchField.C:131
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::zeroGradientFaPatchField::evaluate
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
Evaluate the patch field.
Definition: zeroGradientFaPatchField.C:95
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:69
Foam::zeroGradientFaPatchField::valueBoundaryCoeffs
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the.
Definition: zeroGradientFaPatchField.C:121
Foam::zeroGradientFaPatchField::snGrad
virtual tmp< Field< Type > > snGrad() const
Return gradient at boundary.
Definition: zeroGradientFaPatchField.H:137
Foam::zeroGradientFaPatchField::gradientBoundaryCoeffs
virtual tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the.
Definition: zeroGradientFaPatchField.C:139
Foam::faPatch
Finite area patch class. Used for 2-D non-Euclidian finite area method.
Definition: faPatch.H:69
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54
Foam::UPstream::commsTypes::blocking