LagrangianModelRef.H
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 Class
25  Foam::LagrangianModelRef
26 
27 Description
28  Simple wrapper to provide an optional reference to a Lagrangian model
29 
30 SourceFiles
31  LagrangianModelRef.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef LagrangianModelRef_H
36 #define LagrangianModelRef_H
37 
38 #include "LagrangianSubFieldsFwd.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 class LagrangianSource;
46 class LagrangianInjection;
47 
48 /*---------------------------------------------------------------------------*\
49  Class LagrangianModelRef Declaration
50 \*---------------------------------------------------------------------------*/
51 
53 {
54  // Private Data
55 
56  //- Reference to the source model
57  const LagrangianSource& source_;
58 
59  //- Reference to the source field
60  const LagrangianSubScalarField& S_;
61 
62  //- Reference to the injection model
63  const LagrangianInjection& injection_;
64 
65 
66 public:
67 
68  // Constructors
69 
70  //- Construct null
71  inline LagrangianModelRef();
72 
73  //- Construct for a source
74  inline LagrangianModelRef
75  (
76  const LagrangianSource& source,
78  );
79 
80  //- Construct for an injection
81  inline LagrangianModelRef
82  (
84  );
85 
86 
87  // Member Functions
88 
89  //- Check if the source reference is valid
90  inline bool isSource() const;
91 
92  //- Access the source model
93  inline const LagrangianSource& source() const;
94 
95  //- Access the source field
96  inline const LagrangianSubScalarField& S() const;
97 
98  //- Check if the injection reference is valid
99  inline bool isInjection() const;
100 
101  //- Access the injection model
102  inline const LagrangianInjection& injection() const;
103 };
104 
105 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
106 
107 } // End namespace Foam
108 
109 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
110 
111 #include "LagrangianModelRefI.H"
112 
113 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
114 
115 #endif
116 
117 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Base class for Lagrangian injections. Minimal wrapper over LagrangianSource. Implements some utility ...
Simple wrapper to provide an optional reference to a Lagrangian model.
bool isInjection() const
Check if the injection reference is valid.
const LagrangianSubScalarField & S() const
Access the source field.
const LagrangianInjection & injection() const
Access the injection model.
LagrangianModelRef()
Construct null.
const LagrangianSource & source() const
Access the source model.
bool isSource() const
Check if the source reference is valid.
Base class for Lagrangian sources. Minimal wrapper over LagrangianModel that provides an interface to...
Namespace for OpenFOAM.