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

surfaceNormalFixedValueFvPatchVectorField.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 "surfaceNormalFixedValueFvPatchVectorField.H"
00027 #include <OpenFOAM/addToRunTimeSelectionTable.H>
00028 #include <finiteVolume/volFields.H>
00029 #include <finiteVolume/fvPatchFieldMapper.H>
00030 
00031 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00032 
00033 namespace Foam
00034 {
00035 
00036 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00037 
00038 surfaceNormalFixedValueFvPatchVectorField::
00039 surfaceNormalFixedValueFvPatchVectorField
00040 (
00041     const fvPatch& p,
00042     const DimensionedField<vector, volMesh>& iF
00043 )
00044 :
00045     fixedValueFvPatchVectorField(p, iF),
00046     refValue_(p.size())
00047 {}
00048 
00049 
00050 surfaceNormalFixedValueFvPatchVectorField::
00051 surfaceNormalFixedValueFvPatchVectorField
00052 (
00053     const surfaceNormalFixedValueFvPatchVectorField& ptf,
00054     const fvPatch& p,
00055     const DimensionedField<vector, volMesh>& iF,
00056     const fvPatchFieldMapper& mapper
00057 )
00058 :
00059     fixedValueFvPatchVectorField(p, iF),
00060     refValue_(ptf.refValue_, mapper)
00061 {
00062 //    fvPatchVectorField::operator=(refValue_*patch().nf());
00063 }
00064 
00065 
00066 surfaceNormalFixedValueFvPatchVectorField::
00067 surfaceNormalFixedValueFvPatchVectorField
00068 (
00069     const fvPatch& p,
00070     const DimensionedField<vector, volMesh>& iF,
00071     const dictionary& dict
00072 )
00073 :
00074     fixedValueFvPatchVectorField(p, iF),
00075     refValue_("refValue", dict, p.size())
00076 {
00077     fvPatchVectorField::operator=(refValue_*patch().nf());
00078 }
00079 
00080 
00081 surfaceNormalFixedValueFvPatchVectorField::
00082 surfaceNormalFixedValueFvPatchVectorField
00083 (
00084     const surfaceNormalFixedValueFvPatchVectorField& pivpvf
00085 )
00086 :
00087     fixedValueFvPatchVectorField(pivpvf),
00088     refValue_(pivpvf.refValue_)
00089 {}
00090 
00091 
00092 surfaceNormalFixedValueFvPatchVectorField::
00093 surfaceNormalFixedValueFvPatchVectorField
00094 (
00095     const surfaceNormalFixedValueFvPatchVectorField& pivpvf,
00096     const DimensionedField<vector, volMesh>& iF
00097 )
00098 :
00099     fixedValueFvPatchVectorField(pivpvf, iF),
00100     refValue_(pivpvf.refValue_)
00101 {}
00102 
00103 
00104 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00105 
00106 void surfaceNormalFixedValueFvPatchVectorField::autoMap
00107 (
00108     const fvPatchFieldMapper& m
00109 )
00110 {
00111     fixedValueFvPatchVectorField::autoMap(m);
00112     refValue_.autoMap(m);
00113 }
00114 
00115 
00116 void surfaceNormalFixedValueFvPatchVectorField::rmap
00117 (
00118     const fvPatchVectorField& ptf,
00119     const labelList& addr
00120 )
00121 {
00122     fixedValueFvPatchVectorField::rmap(ptf, addr);
00123 
00124     const surfaceNormalFixedValueFvPatchVectorField& tiptf =
00125         refCast<const surfaceNormalFixedValueFvPatchVectorField>(ptf);
00126 
00127     refValue_.rmap(tiptf.refValue_, addr);
00128 }
00129 
00130 
00131 void surfaceNormalFixedValueFvPatchVectorField::write(Ostream& os) const
00132 {
00133     fvPatchVectorField::write(os);
00134     refValue_.writeEntry("refValue", os);
00135 }
00136 
00137 
00138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00139 
00140 makePatchTypeField
00141 (
00142     fvPatchVectorField,
00143     surfaceNormalFixedValueFvPatchVectorField
00144 );
00145 
00146 
00147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00148 
00149 } // End namespace Foam
00150 
00151 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines