1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM 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 2 of the License, or (at your
14 option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
27 #include "surfaceNormalFixedValueFvPatchVectorField.H"
28 #include "addToRunTimeSelectionTable.H"
29 #include "volFields.H"
30 #include "fvPatchFieldMapper.H"
32 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
37 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
39 surfaceNormalFixedValueFvPatchVectorField::
40 surfaceNormalFixedValueFvPatchVectorField
43 const DimensionedField<vector, volMesh>& iF
46 fixedValueFvPatchVectorField(p, iF),
47 refValue_(p.size(), 0)
51 surfaceNormalFixedValueFvPatchVectorField::
52 surfaceNormalFixedValueFvPatchVectorField
54 const surfaceNormalFixedValueFvPatchVectorField& ptf,
56 const DimensionedField<vector, volMesh>& iF,
57 const fvPatchFieldMapper& mapper
60 fixedValueFvPatchVectorField(p, iF),
61 refValue_(ptf.refValue_, mapper)
63 fvPatchVectorField::operator=(refValue_*patch().nf());
67 surfaceNormalFixedValueFvPatchVectorField::
68 surfaceNormalFixedValueFvPatchVectorField
71 const DimensionedField<vector, volMesh>& iF,
72 const dictionary& dict
75 fixedValueFvPatchVectorField(p, iF),
76 refValue_("refValue", dict, p.size())
78 fvPatchVectorField::operator=(refValue_*patch().nf());
82 surfaceNormalFixedValueFvPatchVectorField::
83 surfaceNormalFixedValueFvPatchVectorField
85 const surfaceNormalFixedValueFvPatchVectorField& pivpvf
88 fixedValueFvPatchVectorField(pivpvf),
89 refValue_(pivpvf.refValue_)
93 surfaceNormalFixedValueFvPatchVectorField::
94 surfaceNormalFixedValueFvPatchVectorField
96 const surfaceNormalFixedValueFvPatchVectorField& pivpvf,
97 const DimensionedField<vector, volMesh>& iF
100 fixedValueFvPatchVectorField(pivpvf, iF),
101 refValue_(pivpvf.refValue_)
105 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
107 void surfaceNormalFixedValueFvPatchVectorField::autoMap
109 const fvPatchFieldMapper& m
112 fixedValueFvPatchVectorField::autoMap(m);
113 refValue_.autoMap(m);
117 void surfaceNormalFixedValueFvPatchVectorField::rmap
119 const fvPatchVectorField& ptf,
120 const labelList& addr
123 fixedValueFvPatchVectorField::rmap(ptf, addr);
125 const surfaceNormalFixedValueFvPatchVectorField& tiptf =
126 refCast<const surfaceNormalFixedValueFvPatchVectorField>(ptf);
128 refValue_.rmap(tiptf.refValue_, addr);
132 void surfaceNormalFixedValueFvPatchVectorField::updateCoeffs()
139 // Bug fix: update for moving mesh. HJ, 15/Oct/2010
140 operator==(refValue_*patch().nf());
144 void surfaceNormalFixedValueFvPatchVectorField::write(Ostream& os) const
146 fvPatchVectorField::write(os);
147 refValue_.writeEntry("refValue", os);
148 writeEntry("value", os);
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 surfaceNormalFixedValueFvPatchVectorField
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 } // End namespace Foam
165 // ************************************************************************* //