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-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 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  //- Copy constructor
103  (
105  );
106 
107  //- Construct and return a clone
108  virtual tmp<fvPatchVectorField> clone() const
109  {
111  (
113  );
114  }
115 
116  //- Copy constructor setting internal field reference
118  (
121  );
122 
123  //- Construct and return a clone setting internal field reference
125  (
127  ) const
128  {
130  (
132  );
133  }
134 
135 
136  // Member Functions
137 
138  // Access
140  virtual const vectorField& traction() const
141  {
142  return traction_;
143  }
145  virtual vectorField& traction()
146  {
147  return traction_;
148  }
149 
150 
151  // Mapping functions
152 
153  //- Map (and resize as needed) from self given a mapping object
154  // Used to update fields following mesh topology change
155  virtual void autoMap(const fvPatchFieldMapper&);
156 
157  //- Reverse map the given fvPatchField onto this fvPatchField
158  // Used to reconstruct fields
159  virtual void rmap(const fvPatchVectorField&, const labelList&);
160 
161 
162  //- Update the coefficients associated with the patch field
163  virtual void updateCoeffs();
164 
165  //- Write
166  virtual void write(Ostream&) const;
167 };
168 
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 } // End namespace Foam
173 
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 
176 #ifdef NoRepository
178 #endif
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 #endif
183 
184 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
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:61
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 tmp< fvPatchVectorField > clone() const
Construct and return a clone.
Foam::fvPatchFieldMapper.
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.