basicLagrangianThermoTemplates.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) 2026 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 "basicLagrangianThermo.H"
27 #include "basicThermo.H"
28 
29 // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
30 
31 template<class LagrangianFieldSourceType>
33 (
35 )
36 {
37  const HashTable<word> Tst = T.sources().types();
38 
39  HashTable<word> psiSt;
40  forAllConstIter(typename HashTable<word>, Tst, iter)
41  {
42  psiSt.set
43  (
44  iter.key(),
46  );
47  }
48 
49  return psiSt;
50 }
51 
52 
53 // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
54 
55 template<class Thermo>
58 (
59  const LagrangianMesh& mesh,
60  const word& phaseName
61 )
62 {
63  const IOdictionary thermoDict
64  (
66  );
67 
68  typename Thermo::LagrangianMeshConstructorTable::iterator cstrIter =
69  basicThermo::lookupCstrIter
70  <
71  Thermo,
72  typename Thermo::LagrangianMeshConstructorTable
73  >
74  (
75  thermoDict,
76  Thermo::LagrangianMeshConstructorTablePtr_
77  );
78 
79  return autoPtr<Thermo>(cstrIter()(mesh, phaseName));
80 }
81 
82 
83 // ************************************************************************* //
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
Definition: UList.H:492
HashTable< word > types() const
Return a map from the source name to the field source type.
Generic GeometricField class.
const Sources & sources() const
Return const-reference to the sources.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:57
Class containing Lagrangian geometry and topology.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
virtual const LagrangianScalarDynamicField & T() const =0
Temperature [K].
static autoPtr< Thermo > New(const LagrangianMesh &mesh, const word &phaseName=word::null)
Select thermo of a given derived type.
static HashTable< word > sourcesTypes(const LagrangianScalarDynamicField &T)
Field sources types.
static IOobject findModelDict(const objectRegistry &obr, const word &group, bool registerObject=false)
Find the physicalProperties dictionary and return the IOobject.
A class for handling words, derived from string.
Definition: word.H:63
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
String typeName(const std::type_info &info)
Return the un-mangled name given the standard type info.
void T(GeometricField< Type, GeoMesh, PrimitiveField1 > &gf, const GeometricField< Type, GeoMesh, PrimitiveField2 > &gf1)