multivariateSurfaceInterpolationScheme.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
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
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Description
25  Abstract base class for surface interpolation schemes.
26 
27 \*---------------------------------------------------------------------------*/
28 
29 #include "fv.H"
31 #include "volFields.H"
32 #include "surfaceFields.H"
33 
34 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
35 
36 namespace Foam
37 {
38 
39 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
40 
41 //- Construct from face-flux field and coefficient
42 template<class Type>
43 multivariateSurfaceInterpolationScheme<Type>::
44 multivariateSurfaceInterpolationScheme
45 (
46  const fvMesh& mesh,
47  const multivariateSurfaceInterpolationScheme<Type>::fieldTable& vtfs,
48  const surfaceScalarField&,
49  Istream&
50 )
51 :
52  mesh_(mesh),
53  fields_(vtfs)
54 {}
55 
56 
57 // * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * //
58 
59 // Return weighting factors for scheme given by name in dictionary
60 template<class Type>
61 tmp<multivariateSurfaceInterpolationScheme<Type> >
63 (
64  const fvMesh& mesh,
66  const surfaceScalarField& faceFlux,
67  Istream& schemeData
68 )
69 {
70  if (fv::debug)
71  {
72  Info<< "multivariateSurfaceInterpolationScheme<Type>::New"
73  "(const fvMesh& mesh, const fieldTable&, "
74  "const surfaceScalarField&, Istream&) : "
75  "constructing surfaceInterpolationScheme<Type>"
76  << endl;
77  }
78 
79  const word schemeName(schemeData);
80 
81  typename IstreamConstructorTable::iterator constructorIter =
82  IstreamConstructorTablePtr_->find(schemeName);
83 
84  if (constructorIter == IstreamConstructorTablePtr_->end())
85  {
87  (
88  "multivariateSurfaceInterpolationScheme<Type>::New"
89  "(const fvMesh& mesh, const fieldTable&, "
90  "const surfaceScalarField&, Istream&)",
91  schemeData
92  ) << "Unknown discretisation scheme " << schemeName << nl << nl
93  << "Valid schemes are :" << endl
94  << IstreamConstructorTablePtr_->sortedToc()
95  << exit(FatalIOError);
96  }
97 
98  return constructorIter()(mesh, vtfs, faceFlux, schemeData);
99 }
100 
101 
102 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
103 
104 template<class Type>
107 {}
108 
109 
110 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
111 
112 } // End namespace Foam
113 
114 // ************************************************************************* //
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Foam::surfaceFields.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
const fvMesh & mesh() const
Return mesh reference.
A class for handling words, derived from string.
Definition: word.H:59
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
static tmp< multivariateSurfaceInterpolationScheme< Type > > New(const fvMesh &mesh, const fieldTable &fields, const surfaceScalarField &faceFlux, Istream &schemeData)
Return a pointer to a new gradScheme created on freestore.
messageStream Info
dynamicFvMesh & mesh
Namespace for OpenFOAM.
static const char nl
Definition: Ostream.H:260
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
IOerror FatalIOError
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
#define FatalIOErrorIn(functionName, ios)
Report an error message using Foam::FatalIOError.
Definition: error.H:325