clampedPlateFaPatchField.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) 2020 OpenCFD Ltd.
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::clampedPlateFaPatchField
28 
29 Description
30  This BC provides a clamped BC. It sets zero fixed value and zeroGradient.
31 
32 Usage
33  Example of the boundary condition specification:
34  \verbatim
35  <patchName>
36  {
37  // Mandatory entries (unmodifiable)
38  type clampedPlate;
39 
40  // Mandatory/Optional (inherited) entries
41  ...
42  }
43  \endverbatim
44 
45  where the entries mean:
46  \table
47  Property | Description | Type | Reqd | Dflt
48  type | Type name: clampedPlate | word | yes | -
49  \endtable
50 
51  The inherited entries are elaborated in:
52  - \link faPatchFields.H \endlink
53 
54 SourceFiles
55  clampedPlateFaPatchField.C
56 
57 \*---------------------------------------------------------------------------*/
58 
59 #ifndef clampedPlateFaPatchField_H
60 #define clampedPlateFaPatchField_H
61 
62 #include "faPatchField.H"
63 
64 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
65 
66 namespace Foam
67 {
68 
69 /*---------------------------------------------------------------------------*\
70  Class clampedPlateFaPatch Declaration
71 \*---------------------------------------------------------------------------*/
72 
73 template<class Type>
74 class clampedPlateFaPatchField
75 :
76  public faPatchField<Type>
77 {
78 public:
79 
80  //- Runtime type information
81  TypeName("clampedPlate");
82 
83 
84  // Constructors
85 
86  //- Construct from patch and internal field
88  (
89  const faPatch&,
91  );
92 
93  //- Construct from patch, internal field and dictionary
94  // The "value" entry: NO_READ
96  (
97  const faPatch&,
99  const dictionary&
100  );
101 
102  //- Construct by mapping the given clampedPlate patch field
103  //- onto a new patch
105  (
107  const faPatch&,
109  const faPatchFieldMapper&
110  );
111 
112  //- Construct as copy
114  (
116  );
117 
118  //- Construct and return a clone
119  virtual tmp<faPatchField<Type>> clone() const
120  {
121  return tmp<faPatchField<Type>>
122  (
124  );
125  }
126 
127  //- Construct as copy setting internal field reference
129  (
132  );
133 
134  //- Construct and return a clone setting internal field reference
136  (
138  ) const
139  {
140  return tmp<faPatchField<Type>>
141  (
142  new clampedPlateFaPatchField<Type>(*this, iF)
143  );
144  }
145 
146 
147  //- Destructor
148  virtual ~clampedPlateFaPatchField() = default;
149 
150 
151  // Member Functions
152 
153  // Evaluation
154 
155  //- Return gradient at boundary
156  virtual tmp<Field<Type>> snGrad() const
157  {
158  return tmp<Field<Type>>
159  (
160  new Field<Type>(this->size(), Zero)
161  );
162  }
163 
164  //- Evaluate the patch field
165  virtual void evaluate
166  (
168  );
169 
170  //- Return the matrix diagonal coefficients corresponding to the
171  //- evaluation of the value of this patchField with given weights
173  (
174  const tmp<scalarField>&
175  ) const;
176 
177  //- Return the matrix source coefficients corresponding to the
178  //- evaluation of the value of this patchField with given weights
180  (
181  const tmp<scalarField>&
182  ) const;
183 
184  //- Return the matrix diagonal coefficients corresponding to the
185  //- evaluation of the gradient of this patchField
186  virtual tmp<Field<Type>> gradientInternalCoeffs() const;
187 
188  //- Return the matrix source coefficients corresponding to the
189  //- evaluation of the gradient of this patchField
190  virtual tmp<Field<Type>> gradientBoundaryCoeffs() const;
191 
192 
193  // IO
194 
195  //- Write
196  virtual void write(Ostream&) const;
197 };
198 
199 
200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201 
202 } // End namespace Foam
203 
204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
205 
206 #ifdef NoRepository
207 # include "clampedPlateFaPatchField.C"
208 #endif
209 
210 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211 
212 #endif
213 
214 // ************************************************************************* //
"blocking" : (MPI_Bsend, MPI_Recv)
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.
virtual tmp< Field< Type > > snGrad() const
Return gradient at boundary.
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
Evaluate the patch field.
virtual tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the evaluation of the gradient of this patchFi...
Generic templated field type.
Definition: Field.H:62
This BC provides a clamped BC. It sets zero fixed value and zeroGradient.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
label size() const noexcept
The number of elements in the container.
Definition: UList.H:671
Finite area patch class. Used for 2-D non-Euclidian finite area method.
Definition: faPatch.H:72
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the evaluation of the value of this patchFie...
virtual ~clampedPlateFaPatchField()=default
Destructor.
virtual tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the evaluation of the gradient of this patch...
TypeName("clampedPlate")
Runtime type information.
clampedPlateFaPatchField(const faPatch &, const DimensionedField< Type, areaMesh > &)
Construct from patch and internal field.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: areaFieldsFwd.H:42
virtual tmp< faPatchField< Type > > clone() const
Construct and return a clone.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
A FieldMapper for finite-area patch fields.
Namespace for OpenFOAM.
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:127
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the evaluation of the value of this patchField...