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-2022 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 
68 public:
69 
70  //- Runtime type information
71  TypeName("tractionDisplacement");
72 
73 
74  // Constructors
75 
76  //- Construct from patch and internal field
78  (
79  const fvPatch&,
81  );
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
131  virtual const vectorField& traction() const
132  {
133  return traction_;
134  }
136  virtual vectorField& traction()
137  {
138  return traction_;
139  }
140 
141 
142  // Mapping functions
143 
144  //- Map (and resize as needed) from self given a mapping object
145  // Used to update fields following mesh topology change
146  virtual void autoMap(const fvPatchFieldMapper&);
147 
148  //- Reverse map the given fvPatchField onto this fvPatchField
149  // Used to reconstruct fields
150  virtual void rmap(const fvPatchVectorField&, const labelList&);
151 
152  //- Reset the fvPatchField to the given fvPatchField
153  // Used for mesh to mesh mapping
154  virtual void reset(const fvPatchVectorField&);
155 
156 
157  //- Update the coefficients associated with the patch field
158  virtual void updateCoeffs();
159 
160  //- Write
161  virtual void write(Ostream&) const;
162 };
163 
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 } // End namespace Foam
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 #ifdef NoRepository
173 #endif
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 #endif
178 
179 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
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.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:63
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:66
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
TypeName("tractionDisplacement")
Runtime type information.
virtual void reset(const fvPatchVectorField &)
Reset the fvPatchField to the given fvPatchField.
Foam::fvPatchFieldMapper.
virtual tmp< fvPatchVectorField > clone(const DimensionedField< vector, volMesh > &iF) const
Construct and return a clone setting internal field reference.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
virtual void rmap(const fvPatchVectorField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Fixed traction boundary condition for the standard linear elastic, fixed coefficient displacement equ...
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
A class for managing temporary objects.
Definition: PtrList.H:53
Namespace for OpenFOAM.