LagrangianDdtScheme.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::Lagrangian::ddtScheme
26 
27 Description
28  Abstract base class for Lagrangian ddt schemes
29 
30 SourceFiles
31  LagrangianDdtScheme.C
32  LagrangianDdtSchemes.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef LagrangianDdtScheme_H
37 #define LagrangianDdtScheme_H
38 
39 #include "tmp.H"
40 #include "dimensionedType.H"
41 #include "LagrangianFieldsFwd.H"
42 #include "LagrangianSubFieldsFwd.H"
43 #include "runTimeSelectionTables.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 class LagrangianMesh;
51 
52 template<class Type>
53 class LagrangianEqn;
54 
55 namespace Lagrangian
56 {
57 
58 /*---------------------------------------------------------------------------*\
59  Class ddtScheme Declaration
60 \*---------------------------------------------------------------------------*/
61 
62 template<class Type>
63 class ddtScheme
64 :
65  public tmp<ddtScheme<Type>>::refCount
66 {
67 protected:
68 
69  // Protected Data
70 
71  //- Reference to the mesh
72  const LagrangianMesh& mesh_;
73 
74 
75 public:
76 
77  //- Runtime type information
78  TypeName("ddtScheme");
79 
80 
81  //- Declare run-time constructor selection tables
83  (
84  tmp,
85  ddtScheme,
86  Istream,
87  (const LagrangianMesh& mesh, Istream& is),
88  (mesh, is)
89  );
90 
91 
92  // Constructors
93 
94  //- Construct from a mesh
96  :
97  mesh_(mesh)
98  {}
99 
100  //- Construct from a mesh and a stream
102  :
103  mesh_(mesh)
104  {}
105 
106  //- Disallow default bitwise copy construction
107  ddtScheme(const ddtScheme&) = delete;
108 
109 
110  // Selectors
111 
112  //- Return a pointer to a new ddtScheme
113  static tmp<ddtScheme<Type>> New
114  (
115  const LagrangianMesh& mesh,
116  Istream& is
117  );
118 
119 
120  //- Destructor
121  virtual ~ddtScheme();
122 
123 
124  // Member Functions
125 
126  //- Return mesh reference
127  const LagrangianMesh& mesh() const
128  {
129  return mesh_;
130  }
131 
132  //- Initialise time-derivative information
133  virtual bool LagrangianmInitDdt
134  (
135  const dimensionSet& mDims,
137  const bool instantaneousDdt
138  ) = 0;
139 
140  //- Return the no-time-derivative matrix
142  (
143  const LagrangianSubScalarField& deltaT,
144  const dimensionSet& mDims,
146  ) = 0;
147 
148  //- Return the time-derivative matrix
150  (
151  const LagrangianSubScalarField& deltaT,
153  ) = 0;
154 
155  //- Return the time-derivative matrix
157  (
158  const LagrangianSubScalarField& deltaT,
161  ) = 0;
162 
163  //- Return the instantaneous time-derivative
165  (
167  ) = 0;
168 
169  //- Return the instantaneous time-derivative
171  (
174  ) = 0;
175 
176  //- Return the time-derivative matrix
178  (
179  const LagrangianSubScalarField& deltaT,
181  );
182 
183  //- Return the time-derivative matrix
185  (
186  const LagrangianSubScalarField& deltaT,
189  );
190 
191  //- Return the explicit/forward time-derivative matrix
193  (
194  const LagrangianSubScalarField& deltaT,
196  );
197 
198  //- Return the explicit/forward time-derivative matrix
200  (
201  const LagrangianSubScalarField& deltaT,
204  );
205 
206 
207  // Member Operators
208 
209  //- Disallow default bitwise assignment
210  void operator=(const ddtScheme&) = delete;
211 };
212 
213 
214 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
215 
216 } // End namespace Lagrangian
217 } // End namespace Foam
218 
219 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
220 
221 #define defineLagrangianDdtScheme(Type, nullArg) \
222  \
223  namespace Foam \
224  { \
225  namespace Lagrangian \
226  { \
227  typedef ddtScheme<Type> Type##DdtScheme; \
228  \
229  defineNamedTemplateTypeNameAndDebug(Type##DdtScheme, 0); \
230  \
231  defineTemplateRunTimeSelectionTable(Type##DdtScheme, Istream); \
232  } \
233  }
234 
235 
236 #define makeLagrangianDdtScheme(Type, DdtSchemeType) \
237  \
238  namespace Foam \
239  { \
240  namespace Lagrangian \
241  { \
242  typedef ddtScheme<Type> Type##DdtScheme; \
243  \
244  namespace ddtSchemes \
245  { \
246  typedef DdtSchemeType<Type> Type##DdtSchemeType; \
247  \
248  defineNamedTemplateTypeNameAndDebug(Type##DdtSchemeType, 0); \
249  \
250  addToRunTimeSelectionTable \
251  ( \
252  Type##DdtScheme, \
253  Type##DdtSchemeType, \
254  Istream \
255  ); \
256  } \
257  } \
258  }
259 
260 
261 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
262 
263 #ifdef NoRepository
264  #include "LagrangianDdtScheme.C"
265 #endif
266 
267 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
268 
269 #endif
270 
271 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
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.
Abstract base class for Lagrangian ddt schemes.
virtual tmp< LagrangianEqn< Type > > LagrangianmNoDdt(const LagrangianSubScalarField &deltaT, const dimensionSet &mDims, const LagrangianSubSubField< Type > &psi)=0
Return the no-time-derivative matrix.
virtual ~ddtScheme()
Destructor.
static tmp< ddtScheme< Type > > New(const LagrangianMesh &mesh, Istream &is)
Return a pointer to a new ddtScheme.
static tmp< LagrangianEqn< Type > > Lagrangianmddt0(const LagrangianSubScalarField &deltaT, const LagrangianSubSubField< Type > &psi)
Return the explicit/forward time-derivative matrix.
ddtScheme(const LagrangianMesh &mesh)
Construct from a mesh.
declareRunTimeSelectionTable(tmp, ddtScheme, Istream,(const LagrangianMesh &mesh, Istream &is),(mesh, is))
Declare run-time constructor selection tables.
static tmp< LagrangianEqn< Type > > Lagrangianmddt(const LagrangianSubScalarField &deltaT, const LagrangianSubSubField< Type > &psi)
Return the time-derivative matrix.
virtual tmp< LagrangianEqn< Type > > LagrangianmDdt(const LagrangianSubScalarField &deltaT, LagrangianSubSubField< Type > &psi)=0
Return the time-derivative matrix.
void operator=(const ddtScheme &)=delete
Disallow default bitwise assignment.
virtual bool LagrangianmInitDdt(const dimensionSet &mDims, const LagrangianSubSubField< Type > &psi, const bool instantaneousDdt)=0
Initialise time-derivative information.
virtual tmp< LagrangianSubField< Type > > LagrangiancDdt(const LagrangianSubSubField< Type > &psi)=0
Return the instantaneous time-derivative.
const LagrangianMesh & mesh_
Reference to the mesh.
TypeName("ddtScheme")
Runtime type information.
const LagrangianMesh & mesh() const
Return mesh reference.
Dimension set for the base types.
Definition: dimensionSet.H:125
Reference counter for various OpenFOAM components.
Definition: refCount.H:50
A class for managing temporary objects.
Definition: tmp.H:55
const volScalarField & psi
Namespace for OpenFOAM.
Macros to ease declaration of run-time selection tables.