LagrangianModelTemplates.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 "LagrangianModel.H"
27 
28 // * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * * //
29 
30 template<class AlphaRhoFieldType, class ... AlphaRhoFieldTypes>
32 (
33  const AlphaRhoFieldType& alphaRhoField,
34  const AlphaRhoFieldTypes& ... alphaRhoFields
35 )
36 {
37  return fieldName(alphaRhoFields ...);
38 }
39 
40 
41 template<class AlphaRhoFieldType>
43 (
44  const AlphaRhoFieldType& alphaRhoField
45 )
46 {
47  const word group = alphaRhoField.group();
48  const word member = alphaRhoField.member();
49  const string::size_type i = member.find(':');
50  return IOobject::groupName(member(i), group);
51 }
52 
53 
54 template<class AlphaRhoFieldType, class ... AlphaRhoFieldTypes>
56 (
57  const AlphaRhoFieldType& alphaRhoField,
58  const AlphaRhoFieldTypes& ... alphaRhoFields
59 )
60 {
61  return fieldName(alphaRhoField) + '*' + fieldsName(alphaRhoFields ...);
62 }
63 
64 
65 template<class AlphaRhoFieldType>
67 (
68  const AlphaRhoFieldType& alphaRhoField
69 )
70 {
71  return fieldName(alphaRhoField);
72 }
73 
74 
75 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
76 
77 template<class Type, template<class> class PrimitiveField>
79 (
81 ) const
82 {
83  return addsSupToField(fieldName(field.name()));
84 }
85 
86 
87 // ************************************************************************* //
88 
graph_traits< Graph >::vertices_size_type size_type
Definition: SloanRenumber.C:73
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const word & name() const
Return name.
Definition: IOobject.H:307
static word groupName(Name name, const word &group)
virtual bool addsSupToField(const word &) const
Return true if the LagrangianModel adds a source term to the.
static word fieldsName(const AlphaRhoFieldType &alphaRhoField, const AlphaRhoFieldTypes &... alphaRhoFields)
Return the name of the product of the fields associated with a.
static word fieldName(const AlphaRhoFieldType &alphaRhoField, const AlphaRhoFieldTypes &... alphaRhoFields)
Return the name of the field associated with a source term.
A class for handling words, derived from string.
Definition: word.H:62
const char *const group
Group name for atomic constants.