tractionDisplacementFvPatchVectorField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2 
3  DAFoam : Discrete Adjoint with OpenFOAM
4  Version : v3
5 
6  This file is modified from OpenFOAM's source code
7  applications/solvers/stressAnalysis/solidDisplacementFoam/tractionDisplacement/
8  tractionDisplacementFvPatchVectorField.H
9 
10  OpenFOAM: The Open Source CFD Toolbox
11 
12  Copyright (C): 2011-2016 OpenFOAM Foundation
13 
14  OpenFOAM License:
15 
16  OpenFOAM is free software: you can redistribute it and/or modify it
17  under the terms of the GNU General Public License as published by
18  the Free Software Foundation, either version 3 of the License, or
19  (at your option) any later version.
20 
21  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
22  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
23  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
24  for more details.
25 
26  You should have received a copy of the GNU General Public License
27  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
28 
29  Description:
30  Fixed traction boundary condition for the standard linear elastic,
31  fixed coefficient displacement equation.
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef tractionDisplacementFvPatchVectorField_H
36 #define tractionDisplacementFvPatchVectorField_H
37 
38 #include "fvPatchFields.H"
39 #include "fixedGradientFvPatchFields.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class tractionDisplacementFvPatch Declaration
48 \*---------------------------------------------------------------------------*/
49 
51  : public fixedGradientFvPatchVectorField
52 {
53 
54  // Private Data
55 
56  vectorField traction_;
57  scalarField pressure_;
58 
59 public:
60  //- Runtime type information
61  TypeName("tractionDisplacement");
62 
63  // Constructors
64 
65  //- Construct from patch and internal field
67  const fvPatch&,
68  const DimensionedField<vector, volMesh>&);
69 
70  //- Construct from patch, internal field and dictionary
72  const fvPatch&,
73  const DimensionedField<vector, volMesh>&,
74  const dictionary&);
75 
76  //- Construct by mapping given
77  // tractionDisplacementFvPatchVectorField onto a new patch
80  const fvPatch&,
81  const DimensionedField<vector, volMesh>&,
82  const fvPatchFieldMapper&);
83 
84  //- Construct as copy
87 
88  //- Construct and return a clone
89  virtual tmp<fvPatchVectorField> clone() const
90  {
91  return tmp<fvPatchVectorField>(
93  }
94 
95  //- Construct as copy setting internal field reference
98  const DimensionedField<vector, volMesh>&);
99 
100  //- Construct and return a clone setting internal field reference
101  virtual tmp<fvPatchVectorField> clone(
102  const DimensionedField<vector, volMesh>& iF) const
103  {
104  return tmp<fvPatchVectorField>(
106  }
107 
108  // Member functions
109 
110  // Access
111 
112  virtual const vectorField& traction() const
113  {
114  return traction_;
115  }
116 
117  virtual vectorField& traction()
118  {
119  return traction_;
120  }
121 
122  virtual const scalarField& pressure() const
123  {
124  return pressure_;
125  }
126 
127  virtual scalarField& pressure()
128  {
129  return pressure_;
130  }
131 
132  // Mapping functions
133 
134  //- Map (and resize as needed) from self given a mapping object
135  virtual void autoMap(
136  const fvPatchFieldMapper&);
137 
138  //- Reverse map the given fvPatchField onto this fvPatchField
139  virtual void rmap(
140  const fvPatchVectorField&,
141  const labelList&);
142 
143  //- Update the coefficients associated with the patch field
144  virtual void updateCoeffs();
145 
146  //- Write
147  virtual void write(Ostream&) const;
148 };
149 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
152 } // End namespace Foam
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 #endif
157 
158 // ************************************************************************* //
Foam::tractionDisplacementFvPatchVectorField::traction
virtual const vectorField & traction() const
Definition: tractionDisplacementFvPatchVectorField.H:112
Foam::tractionDisplacementFvPatchVectorField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Definition: tractionDisplacementFvPatchVectorField.C:101
Foam::tractionDisplacementFvPatchVectorField::tractionDisplacementFvPatchVectorField
tractionDisplacementFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Definition: tractionDisplacementFvPatchVectorField.C:43
Foam::tractionDisplacementFvPatchVectorField::clone
virtual tmp< fvPatchVectorField > clone() const
Definition: tractionDisplacementFvPatchVectorField.H:89
Foam::tractionDisplacementFvPatchVectorField::pressure
virtual scalarField & pressure()
Definition: tractionDisplacementFvPatchVectorField.H:127
Foam::tractionDisplacementFvPatchVectorField::updateCoeffs
virtual void updateCoeffs()
Definition: tractionDisplacementFvPatchVectorField.C:126
Foam
Definition: multiFreqScalarFvPatchField.C:144
Foam::tractionDisplacementFvPatchVectorField::rmap
virtual void rmap(const fvPatchVectorField &, const labelList &)
Definition: tractionDisplacementFvPatchVectorField.C:111
Foam::tractionDisplacementFvPatchVectorField
Definition: tractionDisplacementFvPatchVectorField.H:50
Foam::tractionDisplacementFvPatchVectorField::write
virtual void write(Ostream &) const
Definition: tractionDisplacementFvPatchVectorField.C:174
Foam::tractionDisplacementFvPatchVectorField::traction
virtual vectorField & traction()
Definition: tractionDisplacementFvPatchVectorField.H:117
Foam::tractionDisplacementFvPatchVectorField::clone
virtual tmp< fvPatchVectorField > clone(const DimensionedField< vector, volMesh > &iF) const
Definition: tractionDisplacementFvPatchVectorField.H:101
Foam::tractionDisplacementFvPatchVectorField::pressure
virtual const scalarField & pressure() const
Definition: tractionDisplacementFvPatchVectorField.H:122
Foam::tractionDisplacementFvPatchVectorField::TypeName
TypeName("tractionDisplacement")