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 as copy setting internal field reference
120  (
123  );
124 
125  //- Return clone
126  virtual tmp<faPatchField<Type>> clone() const
127  {
128  return faPatchField<Type>::Clone(*this);
129  }
130 
131  //- Clone with an internal field reference
133  (
135  ) const
136  {
137  return faPatchField<Type>::Clone(*this, iF);
138  }
139 
140 
141  //- Destructor
142  virtual ~clampedPlateFaPatchField() = default;
143 
144 
145  // Member Functions
146 
147  // Evaluation
149  //- Return gradient at boundary
150  virtual tmp<Field<Type>> snGrad() const
151  {
152  return tmp<Field<Type>>::New(this->size(), Foam::zero{});
153  }
154 
155  //- Evaluate the patch field
156  virtual void evaluate
157  (
159  );
160 
161  //- Return the matrix diagonal coefficients corresponding to the
162  //- evaluation of the value of this patchField with given weights
164  (
165  const tmp<scalarField>&
166  ) const;
167 
168  //- Return the matrix source coefficients corresponding to the
169  //- evaluation of the value of this patchField with given weights
171  (
172  const tmp<scalarField>&
173  ) const;
174 
175  //- Return the matrix diagonal coefficients corresponding to the
176  //- evaluation of the gradient of this patchField
177  virtual tmp<Field<Type>> gradientInternalCoeffs() const;
179  //- Return the matrix source coefficients corresponding to the
180  //- evaluation of the gradient of this patchField
181  virtual tmp<Field<Type>> gradientBoundaryCoeffs() const;
182 
183 
184  // IO
185 
186  //- Write includes "value" entry
187  virtual void write(Ostream&) const;
188 };
189 
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 } // End namespace Foam
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 #ifdef NoRepository
198 # include "clampedPlateFaPatchField.C"
199 #endif
200 
201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 
203 #endif
204 
205 // ************************************************************************* //
static tmp< faPatchField< Type > > New(const word &patchFieldType, const word &actualPatchType, const faPatch &, const DimensionedField< Type, areaMesh > &)
Return a pointer to a new patchField created on freestore given patch and internal field...
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 includes "value" entry.
virtual tmp< Field< Type > > snGrad() const
Return gradient at boundary.
virtual tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the evaluation of the gradient of this patchFi...
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
static tmp< faPatchField< Type > > Clone(const DerivedPatchField &pf)
Clone a patch field with its own internal field reference.
Definition: faPatchField.H:513
label size() const noexcept
The number of elements in the container.
Definition: UList.H:680
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...
virtual tmp< faPatchField< Type > > clone() const
Return clone.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition: zero.H:57
A class for managing temporary objects.
Definition: HashPtrTable.H:50
"buffered" : (MPI_Bsend, MPI_Recv)
A FieldMapper for finite-area patch fields.
Namespace for OpenFOAM.
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::buffered)
Evaluate the patch field.
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the evaluation of the value of this patchField...