tractionDisplacementFvPatchVectorField.H
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 Class
25  Foam::tractionDisplacementFvPatchVectorField
26 
27 Description
28  Fixed traction boundary condition for the standard linear elastic, fixed
29  coefficient displacement equation.
30 
31 SourceFiles
32  tractionDisplacementFvPatchVectorField.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef tractionDisplacementFvPatchVectorField_H
37 #define tractionDisplacementFvPatchVectorField_H
38 
40 #include "Function1.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class tractionDisplacementFvPatch Declaration
49 \*---------------------------------------------------------------------------*/
50 
52 :
53  public fixedGradientFvPatchVectorField
54 {
55  // Private Data
56 
57  vectorField traction_;
58  autoPtr<Function1<scalar>> pressure_;
59 
60 protected:
61 
62  //- Update the coefficients associated with the patch field
63  // for the given pressure
64  template<class Type>
65  void updateCoeffs(const Type& pressure);
66 
67  //- Construct from patch and internal field
69  (
70  const fvPatch&,
72  );
73 
74 
75 public:
76 
77  //- Runtime type information
78  TypeName("tractionDisplacement");
79 
80 
81  // Constructors
82 
83  //- Construct from patch, internal field and dictionary
85  (
86  const fvPatch&,
88  const dictionary&
89  );
90 
91  //- Construct by mapping given
92  // tractionDisplacementFvPatchVectorField onto a new patch
94  (
96  const fvPatch&,
98  const fvPatchFieldMapper&
99  );
100 
101  //- Disallow copy without setting internal field reference
103  (
105  ) = delete;
106 
107  //- Copy constructor setting internal field reference
109  (
112  );
113 
114  //- Construct and return a clone setting internal field reference
116  (
118  ) const
119  {
121  (
123  );
124  }
125 
126 
127  // Member Functions
128 
129  // Access
130 
131  virtual const vectorField& traction() const
132  {
133  return traction_;
134  }
135 
136  virtual vectorField& traction()
137  {
138  return traction_;
139  }
140 
141 
142  // Mapping functions
143 
144  //- Map the given fvPatchField onto this fvPatchField
145  virtual void map
146  (
147  const fvPatchVectorField&,
148  const fvPatchFieldMapper&
149  );
150 
151  //- Reset the fvPatchField to the given fvPatchField
152  // Used for mesh to mesh mapping
153  virtual void reset(const fvPatchVectorField&);
154 
155 
156  //- Update the coefficients associated with the patch field
157  virtual void updateCoeffs();
158 
159  //- Write
160  virtual void write(Ostream&) const;
161 };
162 
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 } // End namespace Foam
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 #ifdef NoRepository
172 #endif
173 
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 
176 #endif
177 
178 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
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
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:64
A class for managing temporary objects.
Definition: tmp.H:55
Fixed traction boundary condition for the standard linear elastic, fixed coefficient displacement equ...
virtual tmp< fvPatchVectorField > clone(const DimensionedField< vector, volMesh > &iF) const
Construct and return a clone setting internal field reference.
TypeName("tractionDisplacement")
Runtime type information.
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.