Merge branch 'master' of ssh://git.code.sf.net/p/foam-extend/foam-extend-3.2
[foam-extend-3.2.git] / src / finiteVolume / fields / fvPatchFields / derived / surfaceNormalFixedValue / surfaceNormalFixedValueFvPatchVectorField.C
blob95c8133ea48d914de0907391dd2f3ef9dfd8630b
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | foam-extend: Open Source CFD
4    \\    /   O peration     | Version:     3.2
5     \\  /    A nd           | Web:         http://www.foam-extend.org
6      \\/     M anipulation  | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
8 License
9     This file is part of foam-extend.
11     foam-extend 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 3 of the License, or (at your
14     option) any later version.
16     foam-extend is distributed in the hope that it will be useful, but
17     WITHOUT ANY WARRANTY; without even the implied warranty of
18     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19     General Public License for more details.
21     You should have received a copy of the GNU General Public License
22     along with foam-extend.  If not, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 #include "surfaceNormalFixedValueFvPatchVectorField.H"
27 #include "addToRunTimeSelectionTable.H"
28 #include "volFields.H"
29 #include "fvPatchFieldMapper.H"
31 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
33 namespace Foam
36 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
38 surfaceNormalFixedValueFvPatchVectorField::
39 surfaceNormalFixedValueFvPatchVectorField
41     const fvPatch& p,
42     const DimensionedField<vector, volMesh>& iF
45     fixedValueFvPatchVectorField(p, iF),
46     refValue_(p.size(), 0)
50 surfaceNormalFixedValueFvPatchVectorField::
51 surfaceNormalFixedValueFvPatchVectorField
53     const surfaceNormalFixedValueFvPatchVectorField& ptf,
54     const fvPatch& p,
55     const DimensionedField<vector, volMesh>& iF,
56     const fvPatchFieldMapper& mapper
59     fixedValueFvPatchVectorField(ptf, p, iF, mapper),
60     refValue_(ptf.refValue_, mapper)
64 surfaceNormalFixedValueFvPatchVectorField::
65 surfaceNormalFixedValueFvPatchVectorField
67     const fvPatch& p,
68     const DimensionedField<vector, volMesh>& iF,
69     const dictionary& dict
72     fixedValueFvPatchVectorField(p, iF, dict),
73     refValue_("refValue", dict, p.size())
77 surfaceNormalFixedValueFvPatchVectorField::
78 surfaceNormalFixedValueFvPatchVectorField
80     const surfaceNormalFixedValueFvPatchVectorField& pivpvf
83     fixedValueFvPatchVectorField(pivpvf),
84     refValue_(pivpvf.refValue_)
88 surfaceNormalFixedValueFvPatchVectorField::
89 surfaceNormalFixedValueFvPatchVectorField
91     const surfaceNormalFixedValueFvPatchVectorField& pivpvf,
92     const DimensionedField<vector, volMesh>& iF
95     fixedValueFvPatchVectorField(pivpvf, iF),
96     refValue_(pivpvf.refValue_)
100 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
102 void surfaceNormalFixedValueFvPatchVectorField::autoMap
104     const fvPatchFieldMapper& m
107     fixedValueFvPatchVectorField::autoMap(m);
108     refValue_.autoMap(m);
112 void surfaceNormalFixedValueFvPatchVectorField::rmap
114     const fvPatchVectorField& ptf,
115     const labelList& addr
118     fixedValueFvPatchVectorField::rmap(ptf, addr);
120     const surfaceNormalFixedValueFvPatchVectorField& tiptf =
121         refCast<const surfaceNormalFixedValueFvPatchVectorField>(ptf);
123     refValue_.rmap(tiptf.refValue_, addr);
127 void surfaceNormalFixedValueFvPatchVectorField::updateCoeffs()
129     if (updated())
130     {
131         return;
132     }
134     // Bug fix: update for moving mesh.  HJ, 15/Oct/2010
135     operator==(refValue_*patch().nf());
139 void surfaceNormalFixedValueFvPatchVectorField::write(Ostream& os) const
141     fixedValueFvPatchVectorField::write(os);
142     refValue_.writeEntry("refValue", os);
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 makePatchTypeField
150     fvPatchVectorField,
151     surfaceNormalFixedValueFvPatchVectorField
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 } // End namespace Foam
159 // ************************************************************************* //