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 -------------------------------------------------------------------------------
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 \*---------------------------------------------------------------------------*/
27 
29 #include "areaFields.H"
32 
33 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
34 
35 namespace Foam
36 {
37 
38 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
39 
40 template<class Type>
42 (
43  const faPatch& p,
45 )
46 :
48 {}
49 
50 
51 template<class Type>
53 (
54  const faPatch& p,
56  const dictionary& dict
57 )
58 :
60 {
61  faPatchField<Type>::operator=(this->patchInternalField());
62 }
63 
64 
65 template<class Type>
67 (
69  const faPatch& p,
71  const faPatchFieldMapper& mapper
72 )
73 :
74  faPatchField<Type>(ptf, p, iF, mapper)
75 {}
76 
77 
78 template<class Type>
80 (
82 )
83 :
85 {}
86 
87 
88 template<class Type>
90 (
93 )
94 :
95  faPatchField<Type>(ptf, iF)
96 {}
97 
98 
99 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
100 
101 template<class Type>
103 {
104  notImplemented(type() + "::evaluate(const Pstream::commsType)");
105 }
106 
107 
108 template<>
110 {
111  if (!this->updated())
112  {
113  this->updateCoeffs();
114  }
115 
117 
118  const labelUList& edgeFaces = this->patch().edgeFaces();
119  forAll(edgeFaces, edgeID)
120  {
121  label faceID = edgeFaces[edgeID];
122  const_cast<Field<scalar>&>(this->primitiveField())[faceID] =
124  }
125 
127 }
128 
129 
130 template<class Type>
132 (
133  const tmp<scalarField>&
134 ) const
135 {
136  return tmp<Field<Type>>
137  (new Field<Type>(this->size(), pTraits<Type>::zero));
138 }
139 
140 
141 template<class Type>
143 (
144  const tmp<scalarField>&
145 ) const
146 {
147  return *this;
148 }
149 
150 
151 template<class Type>
154 {
155  return -Type(pTraits<Type>::one)*this->patch().deltaCoeffs();
156 }
157 
158 
159 template<class Type>
162 {
163  return this->patch().deltaCoeffs()*(*this);
164 }
165 
166 
167 template<class Type>
169 {
171  this->writeEntry("value", os);
172 }
173 
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 } // End namespace Foam
178 
179 // ************************************************************************* //
Foam::clampedPlateFaPatchField::valueBoundaryCoeffs
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Definition: clampedPlateFaPatchField.C:143
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::faPatchField
faPatchField<Type> abstract base class. This class gives a fat-interface to all derived classes cover...
Definition: areaFieldsFwd.H:50
Foam::faPatchField::write
virtual void write(Ostream &) const
Write.
Definition: faPatchField.C:207
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::clampedPlateFaPatchField::write
virtual void write(Ostream &) const
Write.
Definition: clampedPlateFaPatchField.C:168
Foam::faPatchFieldMapper
Definition: faPatchFieldMapper.H:44
edgeID
label edgeID
Definition: boundaryProcessorFaPatchPoints.H:6
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:296
Foam::clampedPlateFaPatchField::evaluate
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
Evaluate the patch field.
Definition: clampedPlateFaPatchField.C:102
Foam::Field< scalar >
notImplemented
#define notImplemented(functionName)
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:507
Foam::clampedPlateFaPatchField::gradientBoundaryCoeffs
virtual tmp< Field< Type > > gradientBoundaryCoeffs() const
Definition: clampedPlateFaPatchField.C:161
Foam::faPatchField::evaluate
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
Evaluate the patch field, sets Updated to false.
Definition: faPatchField.C:195
areaFields.H
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
os
OBJstream os(runTime.globalPath()/outputName)
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
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::Field::operator=
void operator=(const Field< Type > &)
Copy assignment.
Definition: Field.C:635
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:69
uniformDimensionedFields.H
Foam::clampedPlateFaPatchField::gradientInternalCoeffs
virtual tmp< Field< Type > > gradientInternalCoeffs() const
Definition: clampedPlateFaPatchField.C:153
Foam::foamVersion::patch
const std::string patch
OpenFOAM patch number as a std::string.
Foam::pTraits
A traits class, which is primarily used for primitives.
Definition: pTraits.H:56
Foam::type
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:590
Foam::UList< label >
Foam::clampedPlateFaPatchField
This BC provides a clamped BC. It sets zero fixe value and zeroGradient.
Definition: clampedPlateFaPatchField.H:85
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
clampedPlateFaPatchField.H
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::faPatchField::operator=
virtual void operator=(const UList< Type > &)
Definition: faPatchField.C:222
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54