LagrangianSpScheme.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) 2025 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 \*---------------------------------------------------------------------------*/
25 
26 #include "LagrangianSpScheme.H"
27 #include "LagrangianSubFields.H"
28 
29 // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
30 
31 template<class Type, class SpType>
34 (
37 )
38 {
39  return Sp*psi;
40 }
41 
42 
43 template<class Type, class SpType>
45 <
47  <
49  >
50 >
52 (
55 )
56 {
57  return Sp & psi;
58 }
59 
60 
61 // * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * //
62 
63 template<class Type, class SpType>
66 (
67  const LagrangianMesh& mesh,
68  Istream& is
69 )
70 {
71  if (is.eof())
72  {
74  << "Sp scheme not specified" << endl << endl
75  << "Valid Sp schemes are :" << endl
76  << IstreamConstructorTablePtr_->sortedToc()
77  << exit(FatalIOError);
78  }
79 
80  const word schemeName(is);
81 
82  typename IstreamConstructorTable::iterator cstrIter =
83  IstreamConstructorTablePtr_->find(schemeName);
84 
85  if (cstrIter == IstreamConstructorTablePtr_->end())
86  {
88  << "Unknown Sp scheme " << schemeName << nl << nl
89  << "Valid Sp schemes are :" << endl
90  << IstreamConstructorTablePtr_->sortedToc()
91  << exit(FatalIOError);
92  }
93 
94  return cstrIter()(mesh, is);
95 }
96 
97 
98 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
99 
100 template<class Type, class SpType>
102 {}
103 
104 
105 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
bool eof() const
Return true if end of input seen.
Definition: IOstream.H:339
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:60
Class containing Lagrangian geometry and topology.
static tmp< SpScheme< Type, SpType > > New(const LagrangianMesh &mesh, Istream &is)
Return a pointer to a new SpScheme.
static tmp< LagrangianSubField< Type > > inner(const LagrangianSubScalarField &Sp, const LagrangianSubSubField< Type > &psi)
Generate the inner product of a scalar coefficient with a field.
virtual ~SpScheme()
Destructor.
typeOfRank< typename pTraits< arg1 >::cmptType, direction(pTraits< arg1 >::rank)+direction(pTraits< arg2 >::rank) - 2 >::type type
Definition: products.H:115
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:62
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Definition: error.H:346
const volScalarField & psi
tmp< VolField< Type > > Sp(const volScalarField &sp, const VolField< Type > &vf)
Definition: fvcSup.C:67
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:258
IOerror FatalIOError
static const char nl
Definition: Ostream.H:267