Loading...
Searching...
No Matches
upwindEdgeInterpolation.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2016-2017 Wikki Ltd
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::upwindEdgeInterpolation
28
29Description
30 Upwind differencing scheme class.
31
32SourceFiles
33 upwindEdgeInterpolation.C
34
35\*---------------------------------------------------------------------------*/
36
37#ifndef upwindEdgeInterpolation_H
38#define upwindEdgeInterpolation_H
39
41#include "areaFields.H"
42#include "edgeFields.H"
43
44// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45
46namespace Foam
47{
48
49/*---------------------------------------------------------------------------*\
50 Class upwind Declaration
51\*---------------------------------------------------------------------------*/
52
53template<class Type>
55:
56 virtual public edgeInterpolationScheme<Type>
57{
58 // Private Data
59
60 //- Face flux
61 const edgeScalarField& faceFlux_;
62
63
64public:
65
66 //- Runtime type information
67 TypeName("upwind");
68
69
70 // Generated Methods
71
72 //- No copy construct
75 //- No copy assignment
76 void operator=(const upwindEdgeInterpolation&) = delete;
77
78
79 // Constructors
80
81 //- Construct from faceFlux
83 (
84 const faMesh& mesh,
85 const edgeScalarField& faceFlux
86 )
87 :
89 faceFlux_(faceFlux)
90 {}
91
92 //- Construct from Istream.
93 // The name of the flux field is read from the Istream and looked-up
94 // from the database
96 (
97 const faMesh& mesh,
98 Istream& is
99 )
100 :
102 faceFlux_
104 mesh.thisDb().lookupObject<edgeScalarField>
105 (
106 word(is)
107 )
108 )
109 {}
110
111 //- Construct from faceFlux and Istream
113 (
114 const faMesh& mesh,
115 const edgeScalarField& faceFlux,
116 Istream&
117 )
118 :
120 faceFlux_(faceFlux)
121 {}
123
124 // Member Functions
125
126 //- Return the interpolation weighting factors
128 (
130 ) const
131 {
132 return pos(faceFlux_);
133 }
134};
135
136
137// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138
139} // End namespace Foam
140
141// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142
143#endif
144
145// ************************************************************************* //
Generic GeometricField class.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition Istream.H:60
Abstract base class for edge interpolation schemes.
edgeInterpolationScheme(const edgeInterpolationScheme &)=delete
No copy construct.
const faMesh & mesh() const
Return mesh reference.
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
Definition faMesh.H:140
A class for managing temporary objects.
Definition tmp.H:75
upwindEdgeInterpolation(const faMesh &mesh, Istream &is)
Construct from Istream.
upwindEdgeInterpolation(const faMesh &mesh, const edgeScalarField &faceFlux, Istream &)
Construct from faceFlux and Istream.
upwindEdgeInterpolation(const faMesh &mesh, const edgeScalarField &faceFlux)
Construct from faceFlux.
upwindEdgeInterpolation(const upwindEdgeInterpolation &)=delete
No copy construct.
virtual tmp< edgeScalarField > weights(const GeometricField< Type, faPatchField, areaMesh > &) const
Return the interpolation weighting factors.
TypeName("upwind")
Runtime type information.
void operator=(const upwindEdgeInterpolation &)=delete
No copy assignment.
A class for handling words, derived from Foam::string.
Definition word.H:66
dynamicFvMesh & mesh
Namespace for OpenFOAM.
dimensionedScalar pos(const dimensionedScalar &ds)
GeometricField< scalar, faePatchField, edgeMesh > edgeScalarField
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68