Initial commit for version 2.0.x patch release
[OpenFOAM-2.0.x.git] / applications / solvers / stressAnalysis / solidDisplacementFoam / tractionDisplacement / tractionDisplacementFvPatchVectorField.H
blobb04a74dcdb44c26dac8a6c61a0a4532d10ee9472
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2004-2010 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
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.
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.
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/>.
24 Class
25     Foam::tractionDisplacementFvPatchVectorField
27 Description
28     Fixed traction boundary condition for the standard linear elastic, fixed
29     coefficient displacement equation.
31 SourceFiles
32     tractionDisplacementFvPatchVectorField.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef tractionDisplacementFvPatchVectorField_H
37 #define tractionDisplacementFvPatchVectorField_H
39 #include "fvPatchFields.H"
40 #include "fixedGradientFvPatchFields.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 namespace Foam
47 /*---------------------------------------------------------------------------*\
48                    Class tractionDisplacementFvPatch Declaration
49 \*---------------------------------------------------------------------------*/
51 class tractionDisplacementFvPatchVectorField
53     public fixedGradientFvPatchVectorField
56     // Private Data
58         vectorField traction_;
59         scalarField pressure_;
62 public:
64     //- Runtime type information
65     TypeName("tractionDisplacement");
68     // Constructors
70         //- Construct from patch and internal field
71         tractionDisplacementFvPatchVectorField
72         (
73             const fvPatch&,
74             const DimensionedField<vector, volMesh>&
75         );
77         //- Construct from patch, internal field and dictionary
78         tractionDisplacementFvPatchVectorField
79         (
80             const fvPatch&,
81             const DimensionedField<vector, volMesh>&,
82             const dictionary&
83         );
85         //- Construct by mapping given
86         //  tractionDisplacementFvPatchVectorField onto a new patch
87         tractionDisplacementFvPatchVectorField
88         (
89             const tractionDisplacementFvPatchVectorField&,
90             const fvPatch&,
91             const DimensionedField<vector, volMesh>&,
92             const fvPatchFieldMapper&
93         );
95         //- Construct as copy
96         tractionDisplacementFvPatchVectorField
97         (
98             const tractionDisplacementFvPatchVectorField&
99         );
101         //- Construct and return a clone
102         virtual tmp<fvPatchVectorField> clone() const
103         {
104             return tmp<fvPatchVectorField>
105             (
106                 new tractionDisplacementFvPatchVectorField(*this)
107             );
108         }
110         //- Construct as copy setting internal field reference
111         tractionDisplacementFvPatchVectorField
112         (
113             const tractionDisplacementFvPatchVectorField&,
114             const DimensionedField<vector, volMesh>&
115         );
117         //- Construct and return a clone setting internal field reference
118         virtual tmp<fvPatchVectorField> clone
119         (
120             const DimensionedField<vector, volMesh>& iF
121         ) const
122         {
123             return tmp<fvPatchVectorField>
124             (
125                 new tractionDisplacementFvPatchVectorField(*this, iF)
126             );
127         }
130     // Member functions
132         // Access
134             virtual const vectorField& traction() const
135             {
136                 return traction_;
137             }
139             virtual vectorField& traction()
140             {
141                 return traction_;
142             }
144             virtual const scalarField& pressure() const
145             {
146                 return pressure_;
147             }
149             virtual  scalarField& pressure()
150             {
151                 return pressure_;
152             }
155         // Mapping functions
157             //- Map (and resize as needed) from self given a mapping object
158             virtual void autoMap
159             (
160                 const fvPatchFieldMapper&
161             );
163             //- Reverse map the given fvPatchField onto this fvPatchField
164             virtual void rmap
165             (
166                 const fvPatchVectorField&,
167                 const labelList&
168             );
171         //- Update the coefficients associated with the patch field
172         virtual void updateCoeffs();
174         //- Write
175         virtual void write(Ostream&) const;
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 } // End namespace Foam
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 #endif
187 // ************************************************************************* //