Merge branch 'master' of ssh://git.code.sf.net/p/foam-extend/foam-extend-3.2
[foam-extend-3.2.git] / src / foam / primitives / BlockCoeff / BlockCoeffNorm / BlockCoeffComponentNorm / BlockCoeffComponentNorm.H
blobdb5d9f2fe6bcaeed80d637d0488c85ac30551942
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 Class
25     BlockCoeffComponentNorm
27 Description
28     Class for BlockCoeff norm based on a specified component.
30 Author
31     Klas Jareteg, 2013-03-07
33 SourceFiles
34     BlockCoeffComponentNorm.C
36 \*---------------------------------------------------------------------------*/
38 #ifndef BlockCoeffComponentNorm_H
39 #define BlockCoeffComponentNorm_H
41 #include "blockCoeffs.H"
42 #include "blockCoeffNorms.H"
43 #include "BlockCoeffNorm.H"
44 #include "CoeffField.H"
45 #include "runTimeSelectionTables.H"
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 namespace Foam
52 // * * * * * * Forward declaration of template friend fuctions * * * * * * * //
55 /*---------------------------------------------------------------------------*\
56                         Class BlockCoeffComponentNorm Declaration
57 \*---------------------------------------------------------------------------*/
59 template<class Type>
60 class BlockCoeffComponentNorm
62     public BlockCoeffNorm<Type>
64     // Private data
66         //- Control data dictionary
67         dictionary dict_;
69         //- Component from which the norm is determined
70         const direction cmpt_;
73 protected:
75     // Protected Member Functions
77         //- Return dictionary
78         const dictionary& dict() const
79         {
80             return dict_;
81         }
84 public:
86     //- Runtime type information
87     TypeName("componentNorm");
90     // Constructors
92         //- Construct from dictionary
93         BlockCoeffComponentNorm
94         (
95             const dictionary& dict
96         );
98     // Destructor
100         virtual ~BlockCoeffComponentNorm()
101         {}
104     // Member functions
106         //- Solve
107         virtual scalar normalize
108         (
109             const BlockCoeff<Type>& a
110         );
112         virtual void coeffMag
113         (
114             const CoeffField<Type>& a,
115             Field<scalar>& b
116         );
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 } // End namespace Foam
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 #ifdef NoRepository
127 #   include "BlockCoeffComponentNorm.C"
128 #endif
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 #endif
134 // ************************************************************************* //