CloudStateField.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) 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 Class
25  Foam::CloudStateField
26 
27 Description
28  A field which is stored as part of the state of the cloud. This is a light
29  wrapper around a dynamic Lagrangian field. It provides convenient access
30  consistent with that of the derived fields so that expressions involving
31  both kinds of field are readable.
32 
33 See also
34  Foam::CloudDerivedField
35 
36 SourceFiles
37  CloudStateField.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef CloudStateField_H
42 #define CloudStateField_H
43 
44 #include "LagrangianModelRef.H"
45 #include "LagrangianFields.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 /*---------------------------------------------------------------------------*\
53  Class CloudStateField Declaration
54 \*---------------------------------------------------------------------------*/
55 
56 template<class Type>
57 class CloudStateField
58 :
59  public LagrangianDynamicField<Type>
60 {
61 private:
62 
63  // Private Data
64 
65  //- The cached Lagrangian sub-field
66  mutable autoPtr<LagrangianSubSubField<Type>> psiSubSubPtr_;
67 
68  //- The index of the sub-mesh
69  mutable label psiSubSubMeshIndex_;
70 
71 
72 public:
73 
74  // Constructors
75 
76  //- Use the base field's constructors
78 
79 
80  // Member Functions
81 
82  //- Access a part of the field
84 
85  //- Clear
86  void clear();
87 
88 
89  // Member Operators
90 
91  //- Access the entire field
93  (
94  const LagrangianMesh&
95  ) const;
96 
97  //- Access a part of the field
99  (
100  const LagrangianSubMesh& subMesh
101  ) const;
102 
103  //- Compute and return part of the field associated with a model
105  (
106  const LagrangianModel& model,
107  const LagrangianSubMesh& subMesh
108  ) const;
109 
110  //- Compute and return part of the field associated with a model
112  (
113  const LagrangianModelRef& model,
114  const LagrangianSubMesh& subMesh
115  ) const;
116 };
117 
118 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119 
120 } // End namespace Foam
121 
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123 
124 #ifdef NoRepository
125  #include "CloudStateField.C"
126 #endif
127 
128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 
130 #endif
131 
132 // ************************************************************************* //
A field which is stored as part of the state of the cloud. This is a light wrapper around a dynamic L...
LagrangianSubSubField< Type > & ref(const LagrangianSubMesh &subMesh)
Access a part of the field.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic GeometricField class.
friend Ostream & operator(Ostream &, const GeometricField< Type, GeoMesh, PrimitiveField > &)
Class containing Lagrangian geometry and topology.
Simple wrapper to provide an optional reference to a Lagrangian model.
Base class for Lagrangian models.
Mesh that relates to a sub-section of a Lagrangian mesh. This is used to construct fields that relate...
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A class for managing temporary objects.
Definition: tmp.H:55
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59