FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

tractionDisplacementCorrectionFvPatchVectorField.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software: you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
00023 
00024 \*---------------------------------------------------------------------------*/
00025 
00026 #ifndef tractionDisplacementCorrectionFvPatchVectorField_H
00027 #define tractionDisplacementCorrectionFvPatchVectorField_H
00028 
00029 #include <finiteVolume/fvPatchFields.H>
00030 #include <finiteVolume/fixedGradientFvPatchFields.H>
00031 
00032 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00033 
00034 namespace Foam
00035 {
00036 
00037 /*---------------------------------------------------------------------------*\
00038         Class tractionDisplacementCorrectionStressFvPatch Declaration
00039 \*---------------------------------------------------------------------------*/
00040 
00041 class tractionDisplacementCorrectionFvPatchVectorField
00042 :
00043     public fixedGradientFvPatchVectorField
00044 {
00045 
00046     // Private Data
00047 
00048         vectorField traction_;
00049         scalarField pressure_;
00050 
00051 
00052 public:
00053 
00054     //- Runtime type information
00055     TypeName("tractionDisplacement");
00056 
00057 
00058     // Constructors
00059 
00060         //- Construct from patch and internal field
00061         tractionDisplacementCorrectionFvPatchVectorField
00062         (
00063             const fvPatch&,
00064             const DimensionedField<vector, volMesh>&
00065         );
00066 
00067         //- Construct from patch, internal field and Istream
00068         tractionDisplacementCorrectionFvPatchVectorField
00069         (
00070             const fvPatch&,
00071             const DimensionedField<vector, volMesh>&,
00072             Istream&
00073         );
00074 
00075         //- Construct from patch, internal field and dictionary
00076         tractionDisplacementCorrectionFvPatchVectorField
00077         (
00078             const fvPatch&,
00079             const DimensionedField<vector, volMesh>&,
00080             const dictionary&
00081         );
00082 
00083         //- Construct by mapping given
00084         //  tractionDisplacementCorrectionFvPatchVectorField onto a new patch
00085         tractionDisplacementCorrectionFvPatchVectorField
00086         (
00087             const tractionDisplacementCorrectionFvPatchVectorField&,
00088             const fvPatch&,
00089             const DimensionedField<vector, volMesh>&,
00090             const fvPatchFieldMapper&
00091         );
00092 
00093         //- Construct as copy setting internal field reference
00094         tractionDisplacementCorrectionFvPatchVectorField
00095         (
00096             const tractionDisplacementCorrectionFvPatchVectorField&
00097         );
00098 
00099         //- Construct and return a clone
00100         virtual tmp<fvPatchVectorField> clone() const
00101         {
00102             return tmp<fvPatchVectorField>
00103             (
00104                 new tractionDisplacementCorrectionFvPatchVectorField(*this)
00105             );
00106         }
00107 
00108         //- Construct as copy setting internal field reference
00109         tractionDisplacementCorrectionFvPatchVectorField
00110         (
00111             const tractionDisplacementCorrectionFvPatchVectorField&,
00112             const DimensionedField<vector, volMesh>&
00113         );
00114 
00115         //- Construct and return a clone setting internal field reference
00116         virtual tmp<fvPatchVectorField> clone
00117         (
00118             const DimensionedField<vector, volMesh>& iF
00119         ) const
00120         {
00121             return tmp<fvPatchVectorField>
00122             (
00123                 new tractionDisplacementCorrectionFvPatchVectorField(*this, iF)
00124             );
00125         }
00126 
00127 
00128     // Member functions
00129 
00130         // Access
00131 
00132             virtual const vectorField& traction() const
00133             {
00134                 return traction_;
00135             }
00136 
00137             virtual vectorField& traction()
00138             {
00139                 return traction_;
00140             }
00141 
00142             virtual const scalarField& pressure() const
00143             {
00144                 return pressure_;
00145             }
00146 
00147             virtual  scalarField& pressure()
00148             {
00149                 return pressure_;
00150             }
00151 
00152 
00153         // Mapping functions
00154 
00155             //- Map (and resize as needed) from self given a mapping object
00156             virtual void autoMap
00157             (
00158                 const fvPatchFieldMapper&
00159             );
00160 
00161             //- Reverse map the given fvPatchField onto this fvPatchField
00162             virtual void rmap
00163             (
00164                 const fvPatchVectorField&,
00165                 const labelList&
00166             );
00167 
00168 
00169         //- Update the coefficients associated with the patch field
00170         virtual void updateCoeffs();
00171 
00172         //- Write
00173         virtual void write(Ostream&) const;
00174 };
00175 
00176 
00177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00178 
00179 } // End namespace Foam
00180 
00181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00182 
00183 #endif
00184 
00185 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines