multivariateSurfaceInterpolationScheme.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2018 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 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
35 
36 template<class Type>
39 (
40  const fvMesh& mesh,
41  const multivariateSurfaceInterpolationScheme<Type>::fieldTable& vtfs,
42  const surfaceScalarField&,
43  Istream&
44 )
45 :
46  mesh_(mesh),
47  fields_(vtfs)
48 {}
49 
50 
51 // * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * //
52 
53 template<class Type>
56 (
57  const fvMesh& mesh,
59  const surfaceScalarField& faceFlux,
60  Istream& schemeData
61 )
62 {
63  if (fv::debug)
64  {
66  << "Constructing surfaceInterpolationScheme<Type>" << endl;
67  }
68 
69  const word schemeName(schemeData);
70 
71  typename IstreamConstructorTable::iterator constructorIter =
72  IstreamConstructorTablePtr_->find(schemeName);
73 
74  if (constructorIter == IstreamConstructorTablePtr_->end())
75  {
77  (
78  schemeData
79  ) << "Unknown discretisation scheme " << schemeName << nl << nl
80  << "Valid schemes are :" << endl
81  << IstreamConstructorTablePtr_->sortedToc()
82  << exit(FatalIOError);
83  }
84 
85  return constructorIter()(mesh, vtfs, faceFlux, schemeData);
86 }
87 
88 
89 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
90 
91 template<class Type>
94 {}
95 
96 
97 // ************************************************************************* //
Foam::surfaceFields.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:256
dynamicFvMesh & mesh
A class for handling words, derived from string.
Definition: word.H:59
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.
static const char nl
Definition: Ostream.H:265
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Definition: error.H:331
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Abstract base class for multi-variate surface interpolation schemes.
A class for managing temporary objects.
Definition: PtrList.H:53
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
IOerror FatalIOError
#define InfoInFunction
Report an information message using Foam::Info.