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

fixedNormalSlipPointPatchField.C

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 #include "fixedNormalSlipPointPatchField.H"
00027 
00028 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00029 
00030 namespace Foam
00031 {
00032 
00033 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00034 
00035 template<class Type>
00036 fixedNormalSlipPointPatchField<Type>::fixedNormalSlipPointPatchField
00037 (
00038     const pointPatch& p,
00039     const DimensionedField<Type, pointMesh>& iF
00040 )
00041 :
00042     slipPointPatchField<Type>(p, iF),
00043     n_(vector::max)
00044 {}
00045 
00046 
00047 template<class Type>
00048 fixedNormalSlipPointPatchField<Type>::fixedNormalSlipPointPatchField
00049 (
00050     const pointPatch& p,
00051     const DimensionedField<Type, pointMesh>& iF,
00052     const dictionary& dict
00053 )
00054 :
00055     slipPointPatchField<Type>(p, iF, dict),
00056     n_(dict.lookup("n"))
00057 {}
00058 
00059 
00060 template<class Type>
00061 fixedNormalSlipPointPatchField<Type>::fixedNormalSlipPointPatchField
00062 (
00063     const fixedNormalSlipPointPatchField<Type>& ptf,
00064     const pointPatch& p,
00065     const DimensionedField<Type, pointMesh>& iF,
00066     const pointPatchFieldMapper& mapper
00067 )
00068 :
00069     slipPointPatchField<Type>(ptf, p, iF, mapper),
00070     n_(ptf.n_)
00071 {}
00072 
00073 
00074 template<class Type>
00075 fixedNormalSlipPointPatchField<Type>::fixedNormalSlipPointPatchField
00076 (
00077     const fixedNormalSlipPointPatchField<Type>& ptf,
00078     const DimensionedField<Type, pointMesh>& iF
00079 )
00080 :
00081     slipPointPatchField<Type>(ptf, iF),
00082     n_(ptf.n_)
00083 {}
00084 
00085 
00086 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00087 
00088 template<class Type>
00089 void fixedNormalSlipPointPatchField<Type>::evaluate(const Pstream::commsTypes)
00090 {
00091     tmp<Field<Type> > tvalues =
00092         transform(I - n_*n_, this->patchInternalField());
00093 
00094     // Get internal field to insert values into
00095     Field<Type>& iF = const_cast<Field<Type>&>(this->internalField());
00096 
00097     this->setInInternalField(iF, tvalues());
00098 }
00099 
00100 
00101 template<class Type>
00102 void fixedNormalSlipPointPatchField<Type>::write(Ostream& os) const
00103 {
00104     slipPointPatchField<Type>::write(os);
00105     os.writeKeyword("n")
00106         << n_ << token::END_STATEMENT << nl;
00107 }
00108 
00109 
00110 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00111 
00112 } // End namespace Foam
00113 
00114 // ************************************************************************* //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines