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-2020 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,
35  const DimensionedField<vector, volMesh>& iF
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,
51  const DimensionedField<vector, volMesh>& iF,
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,
69  const DimensionedField<vector, volMesh>& iF,
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 (
83 )
84 :
85  fixedGradientFvPatchVectorField(tdpvf),
86  traction_(tdpvf.traction_),
87  pressure_(tdpvf.pressure_, false)
88 {}
89 
90 
93 (
95  const DimensionedField<vector, volMesh>& iF
96 )
97 :
98  fixedGradientFvPatchVectorField(tdpvf, iF),
99  traction_(tdpvf.traction_),
100  pressure_(tdpvf.pressure_, false)
101 {}
102 
103 
104 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
105 
107 (
108  const fvPatchFieldMapper& m
109 )
110 {
111  fixedGradientFvPatchVectorField::autoMap(m);
112  m(traction_, traction_);
113 }
114 
115 
117 (
118  const fvPatchVectorField& ptf,
119  const labelList& addr
120 )
121 {
122  fixedGradientFvPatchVectorField::rmap(ptf, addr);
123 
125  refCast<const tractionDisplacementFvPatchVectorField>(ptf);
126 
127  traction_.rmap(dmptf.traction_, addr);
128 }
129 
130 
132 {
133  if (updated())
134  {
135  return;
136  }
137 
138  this->updateCoeffs(pressure_->value(this->db().time().timeOutputValue()));
139 }
140 
141 
143 {
145  writeEntry(os, "traction", traction_);
146  writeEntry(os, pressure_());
147  writeEntry(os, "value", *this);
148 }
149 
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 namespace Foam
154 {
156  (
159  );
160 }
161 
162 
163 // ************************************************************************* //
fvPatchField< vector > fvPatchVectorField
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
virtual void write(Ostream &) const
Write.
tractionDisplacementFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual void write(Ostream &) const
Write.
Definition: fvPatchField.C:280
Macros for easy insertion into run-time selection tables.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
List< label > labelList
A List of labels.
Definition: labelList.H:56
static const zero Zero
Definition: zero.H:97
virtual void rmap(const fvPatchVectorField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
Definition: HashTableIO.C:96
virtual void operator=(const UList< Type > &)
Definition: fvPatchField.C:295
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
Namespace for OpenFOAM.