Loading...
Searching...
No Matches
clampedPlateFaPatchField.C
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-------------------------------------------------------------------------------
10License
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\*---------------------------------------------------------------------------*/
27
29#include "areaFields.H"
32
33// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
35namespace Foam
36{
37
38// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
39
40template<class Type>
42(
43 const faPatch& p,
46:
47 faPatchField<Type>(p, iF)
48{}
49
50
51template<class Type>
53(
54 const faPatch& p,
56 const dictionary& dict
57)
58:
59 faPatchField<Type>(p, iF, dict, IOobjectOption::NO_READ)
60{
61 this->extrapolateInternal(); // Zero-gradient patch values
62}
63
64
65template<class Type>
67(
69 const faPatch& p,
71 const faPatchFieldMapper& mapper
73:
74 faPatchField<Type>(ptf, p, iF, mapper)
75{}
76
77
78template<class Type>
80(
83:
84 faPatchField<Type>(ptf)
85{}
86
87
88template<class Type>
90(
93)
94:
95 faPatchField<Type>(ptf, iF)
96{}
97
98
99// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
100
101template<class Type>
103{
104 notImplemented(type() + "::evaluate(const Pstream::commsType)");
105}
106
107
108template<>
110{
111 if (!this->updated())
112 {
113 this->updateCoeffs();
114 }
115
117
118 auto& iF = const_cast<Field<scalar>&>(this->primitiveField());
119
120 for (const label facei : this->patch().edgeFaces())
121 {
122 iF[facei] = Zero;
124
126}
127
128
129template<class Type>
131(
132 const tmp<scalarField>&
133) const
134{
135 return tmp<Field<Type>>::New(this->size(), Zero);
136}
137
138
139template<class Type>
141(
142 const tmp<scalarField>&
143) const
145 return *this;
146}
147
148
149template<class Type>
153 return -Type(pTraits<Type>::one)*this->patch().deltaCoeffs();
154}
155
156
157template<class Type>
160{
161 return this->patch().deltaCoeffs()*(*this);
162}
163
164
165template<class Type>
167{
170}
171
172
173// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174
175} // End namespace Foam
176
177// ************************************************************************* //
Macros for easy insertion into run-time selection tables.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
Definition Field.H:172
void operator=(const Field< Type > &)
Copy assignment.
Definition Field.C:781
A simple container of IOobject preferences. Can also be used for general handling of read/no-read/rea...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
void size(const label n)
Definition UList.H:118
commsTypes
Communications types.
Definition UPstream.H:81
This BC provides a clamped BC. It sets zero fixed value and zeroGradient.
virtual void write(Ostream &) const
Write includes "value" entry.
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the evaluation of the value of this patchFie...
clampedPlateFaPatchField(const faPatch &, const DimensionedField< Type, areaMesh > &)
Construct from patch and internal 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...
virtual tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the evaluation of the gradient of this patchFi...
virtual tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the evaluation of the gradient of this patch...
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::buffered)
Evaluate the patch field.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
bool updated() const noexcept
True if the boundary condition has already been updated.
const faPatch & patch() const noexcept
Return the patch.
A FieldMapper for finite-area patch fields.
faPatchField(const faPatch &, const DimensionedField< Type, areaMesh > &)
Construct from patch and internal field.
void writeValueEntry(Ostream &os) const
Write *this field as a "value" entry.
const Field< Type > & primitiveField() const noexcept
Return const-reference to the internal field values.
virtual void write(Ostream &os) const
Write.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
void extrapolateInternal()
Assign the patch field from the internal field.
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::buffered)
Evaluate the patch field, sets updated() to false.
Finite area patch class. Used for 2-D non-Euclidian finite area method.
Definition faPatch.H:76
A traits class, which is primarily used for primitives and vector-space.
Definition pTraits.H:64
A class for managing temporary objects.
Definition tmp.H:75
volScalarField & p
#define notImplemented(functionName)
Issue a FatalErrorIn for a function not currently implemented.
Definition error.H:675
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition POSIX.C:801
static constexpr const zero Zero
Global zero (0).
Definition zero.H:127
dictionary dict
Various UniformDimensionedField types.