Forward compatibility: flex
[foam-extend-3.2.git] / src / solidModels / fvPatchFields / solidTraction / solidTractionFvPatchVectorField.H
blob3063ff15db3018676c96d8920840fa6d6026e553
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | foam-extend: Open Source CFD
4    \\    /   O peration     | Version:     3.2
5     \\  /    A nd           | Web:         http://www.foam-extend.org
6      \\/     M anipulation  | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
8 License
9     This file is part of foam-extend.
11     foam-extend is free software: you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by the
13     Free Software Foundation, either version 3 of the License, or (at your
14     option) any later version.
16     foam-extend is distributed in the hope that it will be useful, but
17     WITHOUT ANY WARRANTY; without even the implied warranty of
18     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19     General Public License for more details.
21     You should have received a copy of the GNU General Public License
22     along with foam-extend.  If not, see <http://www.gnu.org/licenses/>.
24 Class
25     solidTractionFvPatchVectorField
27 Description
28     Fixed traction boundary condition for solid foam solvers.
29     Suitable for for total strain or incremental strain total or
30     updated Lagrangian approaches.
31     Contains thermal-elastic, plastic, non-linear terms if required.
32     And non-orthogonal correction.
34 Author
35    Philip Cardiff
37 SourceFiles
38     solidTractionFvPatchVectorField.C
40 \*---------------------------------------------------------------------------*/
42 #ifndef solidTractionFvPatchVectorField_H
43 #define solidTractionFvPatchVectorField_H
45 #include "fvPatchFields.H"
46 #include "fixedGradientFvPatchFields.H"
47 #include "nonLinearGeometry.H"
48 #include "Switch.H"
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 namespace Foam
55 /*---------------------------------------------------------------------------*\
56                 Class solidTractionFvPatchVectorField Declaration
57 \*---------------------------------------------------------------------------*/
59 class solidTractionFvPatchVectorField
61     public fixedGradientFvPatchVectorField
64     // Private Data
66         //- Name of the displacement field
67         word fieldName_;
69         //- Traction
70         vectorField traction_;
72         //- Pressure
73         scalarField pressure_;
75         //- Type of geometrical non-linearity
76        nonLinearGeometry::nonLinearType nonLinear_;
78         //- if it is an orthropic solver
79         Switch orthotropic_;
82 public:
84     //- Runtime type information
85     TypeName("solidTraction");
88     // Constructors
90         //- Construct from patch and internal field
91         solidTractionFvPatchVectorField
92         (
93             const fvPatch&,
94             const DimensionedField<vector, volMesh>&
95         );
97         //- Construct from patch, internal field and dictionary
98         solidTractionFvPatchVectorField
99         (
100             const fvPatch&,
101             const DimensionedField<vector, volMesh>&,
102             const dictionary&
103         );
105         //- Construct by mapping given
106         //  solidTractionFvPatchVectorField onto a new patch
107         solidTractionFvPatchVectorField
108         (
109             const solidTractionFvPatchVectorField&,
110             const fvPatch&,
111             const DimensionedField<vector, volMesh>&,
112             const fvPatchFieldMapper&
113         );
115         //- Construct as copy
116         solidTractionFvPatchVectorField
117         (
118             const solidTractionFvPatchVectorField&
119         );
121         //- Construct and return a clone
122         virtual tmp<fvPatchVectorField> clone() const
123         {
124             return tmp<fvPatchVectorField>
125             (
126                 new solidTractionFvPatchVectorField(*this)
127             );
128         }
130         //- Construct as copy setting internal field reference
131         solidTractionFvPatchVectorField
132         (
133             const solidTractionFvPatchVectorField&,
134             const DimensionedField<vector, volMesh>&
135         );
137         //- Construct and return a clone setting internal field reference
138         virtual tmp<fvPatchVectorField> clone
139         (
140             const DimensionedField<vector, volMesh>& iF
141         ) const
142         {
143             return tmp<fvPatchVectorField>
144             (
145                 new solidTractionFvPatchVectorField(*this, iF)
146             );
147         }
151     // Member functions
153         // Access
155             virtual const vectorField& traction() const
156             {
157                 return traction_;
158             }
160             virtual vectorField& traction()
161             {
162                 return traction_;
163             }
165             virtual const scalarField& pressure() const
166             {
167                 return pressure_;
168             }
170             virtual scalarField& pressure()
171             {
172                 return pressure_;
173             }
175             virtual word& fieldName()
176             {
177                 return fieldName_;
178             }
180             const nonLinearGeometry::nonLinearType& nonLinear() const
181             {
182                 return nonLinear_;
183             }
185             nonLinearGeometry::nonLinearType& nonLinear()
186             {
187                 return nonLinear_;
188             }
191         // Mapping functions
193             //- Map (and resize as needed) from self given a mapping object
194             virtual void autoMap
195             (
196                 const fvPatchFieldMapper&
197             );
199             //- Reverse map the given fvPatchField onto this fvPatchField
200             virtual void rmap
201             (
202                 const fvPatchVectorField&,
203                 const labelList&
204             );
207         //- Update the coefficients associated with the patch field
208         virtual void updateCoeffs();
210         //- Evaluate the patch field
211         virtual void evaluate
212         (
213             const Pstream::commsTypes commsType=Pstream::blocking
214         );
216         //- Write
217         virtual void write(Ostream&) const;
221 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
223 } // End namespace Foam
225 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
227 #endif
229 // ************************************************************************* //