OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

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-2009 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 the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     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, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 \*---------------------------------------------------------------------------*/
00026 
00027 #include "surfaceNormalFixedValueFvPatchVectorField.H"
00028 #include "addToRunTimeSelectionTable.H"
00029 #include "volFields.H"
00030 #include "fvPatchFieldMapper.H"
00031 
00032 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00033 
00034 namespace Foam
00035 {
00036 
00037 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00038 
00039 surfaceNormalFixedValueFvPatchVectorField::
00040 surfaceNormalFixedValueFvPatchVectorField
00041 (
00042     const fvPatch& p,
00043     const DimensionedField<vector, volMesh>& iF
00044 )
00045 :
00046     fixedValueFvPatchVectorField(p, iF),
00047     refValue_(p.size())
00048 {}
00049 
00050 
00051 surfaceNormalFixedValueFvPatchVectorField::
00052 surfaceNormalFixedValueFvPatchVectorField
00053 (
00054     const surfaceNormalFixedValueFvPatchVectorField& ptf,
00055     const fvPatch& p,
00056     const DimensionedField<vector, volMesh>& iF,
00057     const fvPatchFieldMapper& mapper
00058 )
00059 :
00060     fixedValueFvPatchVectorField(p, iF),
00061     refValue_(ptf.refValue_, mapper)
00062 {
00063     fvPatchVectorField::operator=(refValue_*patch().nf());
00064 }
00065 
00066 
00067 surfaceNormalFixedValueFvPatchVectorField::
00068 surfaceNormalFixedValueFvPatchVectorField
00069 (
00070     const fvPatch& p,
00071     const DimensionedField<vector, volMesh>& iF,
00072     const dictionary& dict
00073 )
00074 :
00075     fixedValueFvPatchVectorField(p, iF),
00076     refValue_("refValue", dict, p.size())
00077 {
00078     fvPatchVectorField::operator=(refValue_*patch().nf());
00079 }
00080 
00081 
00082 surfaceNormalFixedValueFvPatchVectorField::
00083 surfaceNormalFixedValueFvPatchVectorField
00084 (
00085     const surfaceNormalFixedValueFvPatchVectorField& pivpvf
00086 )
00087 :
00088     fixedValueFvPatchVectorField(pivpvf),
00089     refValue_(pivpvf.refValue_)
00090 {}
00091 
00092 
00093 surfaceNormalFixedValueFvPatchVectorField::
00094 surfaceNormalFixedValueFvPatchVectorField
00095 (
00096     const surfaceNormalFixedValueFvPatchVectorField& pivpvf,
00097     const DimensionedField<vector, volMesh>& iF
00098 )
00099 :
00100     fixedValueFvPatchVectorField(pivpvf, iF),
00101     refValue_(pivpvf.refValue_)
00102 {}
00103 
00104 
00105 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00106 
00107 void surfaceNormalFixedValueFvPatchVectorField::autoMap
00108 (
00109     const fvPatchFieldMapper& m
00110 )
00111 {
00112     fixedValueFvPatchVectorField::autoMap(m);
00113     refValue_.autoMap(m);
00114 }
00115 
00116 
00117 void surfaceNormalFixedValueFvPatchVectorField::rmap
00118 (
00119     const fvPatchVectorField& ptf,
00120     const labelList& addr
00121 )
00122 {
00123     fixedValueFvPatchVectorField::rmap(ptf, addr);
00124 
00125     const surfaceNormalFixedValueFvPatchVectorField& tiptf =
00126         refCast<const surfaceNormalFixedValueFvPatchVectorField>(ptf);
00127 
00128     refValue_.rmap(tiptf.refValue_, addr);
00129 }
00130 
00131 
00132 void surfaceNormalFixedValueFvPatchVectorField::write(Ostream& os) const
00133 {
00134     fvPatchVectorField::write(os);
00135     refValue_.writeEntry("refValue", os);
00136 }
00137 
00138 
00139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00140 
00141 makePatchTypeField
00142 (
00143     fvPatchVectorField,
00144     surfaceNormalFixedValueFvPatchVectorField
00145 );
00146 
00147 
00148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00149 
00150 } // End namespace Foam
00151 
00152 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd