1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
5 \\ / A nd | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
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/>.
25 BlockCoeff specialisation for terminal class.
28 Specialisation of a block coefficient for a scalar: always a scalae.
31 Hrvoje Jasak, Wikki Ltd. All rights reserved.
33 \*---------------------------------------------------------------------------*/
35 #ifndef scalarBlockCoeff_H
36 #define scalarBlockCoeff_H
38 #include "BlockCoeff.H"
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 /*---------------------------------------------------------------------------*\
46 Class BlockCoeff Declaration
47 \*---------------------------------------------------------------------------*/
50 class BlockCoeff<scalar>
64 typedef scalar scalarType;
67 //- Multiplication trait
74 Type operator()(const scalarType& c, const Type& x) const
78 Type operator()(const BlockCoeff<Type>& c, const Type& x) const
80 return c.asScalar()*x;
84 scalarType inverse(const scalarType& c) const
89 // Triple product of coefficients
90 scalarType tripleProduct
106 //- Scalar coefficient
115 explicit BlockCoeff();
117 //- Construct as copy
118 BlockCoeff(const BlockCoeff<scalar>&);
120 //- Construct from Istream
121 BlockCoeff(Istream&);
124 BlockCoeff<scalar> clone() const;
134 //- Return active type
135 blockCoeffBase::activeLevel activeType() const;
138 const scalar& asScalar() const
149 const scalar& asLinear() const
160 const scalar& asSquare() const
172 scalar component(const direction) const;
177 void operator=(const BlockCoeff<scalar>&);
180 // IOstream operators
182 friend Ostream& operator<<
185 const BlockCoeff<scalar>&
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 } // End namespace Foam
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 // ************************************************************************* //