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-2024 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 
59  autoPtr<Function1<scalar>> pressure_;
60 
61 
62 protected:
63 
64  //- Update the coefficients associated with the patch field
65  // for the given pressure
66  template<class Type>
67  void updateCoeffs(const Type& pressure);
68 
69  //- Construct from patch and internal field
71  (
72  const fvPatch&,
74  );
75 
76 
77 public:
78 
79  //- Runtime type information
80  TypeName("tractionDisplacement");
81 
82 
83  // Constructors
84 
85  //- Construct from patch, internal field and dictionary
87  (
88  const fvPatch&,
90  const dictionary&
91  );
92 
93  //- Construct by mapping given
94  // tractionDisplacementFvPatchVectorField onto a new patch
96  (
98  const fvPatch&,
100  const fieldMapper&
101  );
102 
103  //- Disallow copy without setting internal field reference
105  (
107  ) = delete;
108 
109  //- Copy constructor setting internal field reference
111  (
114  );
115 
116  //- Construct and return a clone setting internal field reference
118  (
120  ) const
121  {
123  (
125  );
126  }
127 
128 
129  // Member Functions
130 
131  // Access
132 
133  virtual const vectorField& traction() const
134  {
135  return traction_;
136  }
137 
138  virtual vectorField& traction()
139  {
140  return traction_;
141  }
142 
143 
144  // Mapping functions
145 
146  //- Map the given fvPatchField onto this fvPatchField
147  virtual void map(const fvPatchVectorField&, const fieldMapper&);
148 
149  //- Reset the fvPatchField to the given fvPatchField
150  // Used for mesh to mesh mapping
151  virtual void reset(const fvPatchVectorField&);
152 
153 
154  //- Update the coefficients associated with the patch field
155  virtual void updateCoeffs();
156 
157  //- Write
158  virtual void write(Ostream&) const;
159 };
160 
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 } // End namespace Foam
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 #ifdef NoRepository
170 #endif
171 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 
174 #endif
175 
176 // ************************************************************************* //
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:162
Abstract base class for field mapping.
Definition: fieldMapper.H:48
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:88
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 reset(const fvPatchVectorField &)
Reset the fvPatchField to the given fvPatchField.
tractionDisplacementFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
virtual void map(const fvPatchVectorField &, const fieldMapper &)
Map the given fvPatchField onto this fvPatchField.
Namespace for OpenFOAM.