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 fixe 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
95  (
96  const faPatch&,
98  const dictionary&
99  );
100 
101  //- Construct by mapping the given clampedPlateFaPatchField<Type>
102  //- onto a new patch
104  (
106  const faPatch&,
108  const faPatchFieldMapper&
109  );
110 
111  //- Construct as copy
113  (
115  );
116 
117  //- Construct and return a clone
118  virtual tmp<faPatchField<Type>> clone() const
119  {
120  return tmp<faPatchField<Type>>
121  (
123  );
124  }
125 
126  //- Construct as copy setting internal field reference
128  (
131  );
132 
133  //- Construct and return a clone setting internal field reference
134  virtual tmp<faPatchField<Type> > clone
135  (
137  ) const
138  {
139  return tmp<faPatchField<Type> >
140  (
141  new clampedPlateFaPatchField<Type>(*this, iF)
142  );
143  }
144 
145 
146  //- Destructor
147  virtual ~clampedPlateFaPatchField()
148  {}
149 
150 
151  // Member Functions
152 
153  // Evaluation
154 
155  //- Return gradient at boundary
156  virtual tmp<Field<Type>> snGrad() const
157  {
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 // ************************************************************************* //
Foam::clampedPlateFaPatchField::valueBoundaryCoeffs
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Definition: clampedPlateFaPatchField.C:143
Foam::faPatchField
faPatchField<Type> abstract base class. This class gives a fat-interface to all derived classes cover...
Definition: areaFieldsFwd.H:50
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::clampedPlateFaPatchField::write
virtual void write(Ostream &) const
Write.
Definition: clampedPlateFaPatchField.C:168
clampedPlateFaPatchField.C
faPatchField.H
Foam::faPatchFieldMapper
Definition: faPatchFieldMapper.H:44
Foam::clampedPlateFaPatchField::snGrad
virtual tmp< Field< Type > > snGrad() const
Return gradient at boundary.
Definition: clampedPlateFaPatchField.H:167
Foam::clampedPlateFaPatchField::evaluate
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
Evaluate the patch field.
Definition: clampedPlateFaPatchField.C:102
Foam::Field
Generic templated field type.
Definition: Field.H:63
Foam::clampedPlateFaPatchField::gradientBoundaryCoeffs
virtual tmp< Field< Type > > gradientBoundaryCoeffs() const
Definition: clampedPlateFaPatchField.C:161
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::clampedPlateFaPatchField::valueInternalCoeffs
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Definition: clampedPlateFaPatchField.C:132
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:69
Foam::clampedPlateFaPatchField::clone
virtual tmp< faPatchField< Type > > clone() const
Construct and return a clone.
Definition: clampedPlateFaPatchField.H:129
Foam::clampedPlateFaPatchField::gradientInternalCoeffs
virtual tmp< Field< Type > > gradientInternalCoeffs() const
Definition: clampedPlateFaPatchField.C:153
Foam::clampedPlateFaPatchField::TypeName
TypeName("clampedPlate")
Runtime type information.
Foam::clampedPlateFaPatchField
This BC provides a clamped BC. It sets zero fixe value and zeroGradient.
Definition: clampedPlateFaPatchField.H:85
Foam::clampedPlateFaPatchField::~clampedPlateFaPatchField
virtual ~clampedPlateFaPatchField()
Destructor.
Definition: clampedPlateFaPatchField.H:158
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::clampedPlateFaPatchField::clampedPlateFaPatchField
clampedPlateFaPatchField(const faPatch &, const DimensionedField< Type, areaMesh > &)
Construct from patch and internal field.
Definition: clampedPlateFaPatchField.C:42
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