tractionDisplacementFvPatchVectorField.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
28 
29 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
30 
33 (
34  const fvPatch& p,
36 )
37 :
38  fixedGradientFvPatchVectorField(p, iF),
39  traction_(p.size(), Zero),
40  pressure_()
41 {
42  fvPatchVectorField::operator=(patchInternalField());
43  gradient() = Zero;
44 }
45 
46 
49 (
50  const fvPatch& p,
52  const dictionary& dict
53 )
54 :
55  fixedGradientFvPatchVectorField(p, iF),
56  traction_("traction", dict, p.size()),
57  pressure_(Function1<scalar>::New("pressure", dict))
58 {
59  fvPatchVectorField::operator=(patchInternalField());
60  gradient() = Zero;
61 }
62 
63 
66 (
68  const fvPatch& p,
70  const fvPatchFieldMapper& mapper
71 )
72 :
73  fixedGradientFvPatchVectorField(tdpvf, p, iF, mapper),
74  traction_(mapper(tdpvf.traction_)),
75  pressure_(tdpvf.pressure_, false)
76 {}
77 
78 
81 (
84 )
85 :
86  fixedGradientFvPatchVectorField(tdpvf, iF),
87  traction_(tdpvf.traction_),
88  pressure_(tdpvf.pressure_, false)
89 {}
90 
91 
92 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
93 
95 (
96  const fvPatchVectorField& ptf,
97  const fvPatchFieldMapper& mapper
98 )
99 {
100  fixedGradientFvPatchVectorField::map(ptf, mapper);
101 
103  refCast<const tractionDisplacementFvPatchVectorField>(ptf);
104 
105  mapper(traction_, dmptf.traction_);
106 }
107 
108 
110 (
111  const fvPatchVectorField& ptf
112 )
113 {
114  fixedGradientFvPatchVectorField::reset(ptf);
115 
117  refCast<const tractionDisplacementFvPatchVectorField>(ptf);
118 
119  traction_.reset(dmptf.traction_);
120 }
121 
122 
124 {
125  if (updated())
126  {
127  return;
128  }
129 
130  this->updateCoeffs(pressure_->value(this->db().time().userTimeValue()));
131 }
132 
133 
135 {
137  writeEntry(os, "traction", traction_);
138  writeEntry(os, pressure_());
139  writeEntry(os, "value", *this);
140 }
141 
142 
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 
145 namespace Foam
146 {
148  (
151  );
152 }
153 
154 
155 // ************************************************************************* //
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...
Run-time selectable general function of one variable.
Definition: Function1.H:64
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Foam::fvPatchFieldMapper.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:87
virtual void write(Ostream &) const
Write.
Definition: fvPatchField.C:231
virtual void operator=(const UList< Type > &)
Definition: fvPatchField.C:251
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:64
Fixed traction boundary condition for the standard linear elastic, fixed coefficient displacement equ...
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual void map(const fvPatchVectorField &, const fvPatchFieldMapper &)
Map the given fvPatchField onto this fvPatchField.
virtual void reset(const fvPatchVectorField &)
Reset the fvPatchField to the given fvPatchField.
tractionDisplacementFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Namespace for OpenFOAM.
static const zero Zero
Definition: zero.H:97
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
Definition: HashTableIO.C:96
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
dictionary dict
volScalarField & p