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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2019-2021 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
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  auto* ctorPtr = IstreamConstructorTable(schemeName);
72 
73  if (!ctorPtr)
74  {
76  (
77  schemeData,
78  "discretisation",
79  schemeName,
80  *IstreamConstructorTablePtr_
81  ) << exit(FatalIOError);
82  }
83 
84  return ctorPtr(mesh, vtfs, faceFlux, schemeData);
85 }
86 
87 
88 // ************************************************************************* //
Foam::expressions::patchExpr::debug
int debug
Static debugging option.
volFields.H
InfoInFunction
#define InfoInFunction
Report an information message using Foam::Info.
Definition: messageStream.H:350
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
fv.H
Foam::multivariateSurfaceInterpolationScheme::New
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.
Definition: multivariateSurfaceInterpolationScheme.C:56
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::FatalIOError
IOerror FatalIOError
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:369
surfaceFields.H
Foam::surfaceFields.
FatalIOErrorInLookup
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
Definition: error.H:478
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::multivariateSurfaceInterpolationScheme
Abstract base class for multi-variate surface interpolation schemes.
Definition: multivariateSurfaceInterpolationScheme.H:52
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
multivariateSurfaceInterpolationScheme.H
Foam::surfaceScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Definition: surfaceFieldsFwd.H:54
Foam::GeometricField< scalar, fvsPatchField, surfaceMesh >
Foam::multivariateSurfaceInterpolationScheme::fieldTable
fieldTable
Definition: multivariateSurfaceInterpolationScheme.H:60