CloudFunctionObject.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) 2011-2022 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 "CloudFunctionObject.H"
27 #include "writeFile.H"
28 
29 // * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * //
30 
31 template<class CloudType>
33 {
35 }
36 
37 
38 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
39 
40 template<class CloudType>
42 :
44  outputDir_()
45 {}
46 
47 
48 template<class CloudType>
50 (
51  const dictionary& dict,
52  CloudType& owner,
53  const word& modelName,
54  const word& objectType
55 )
56 :
57  CloudSubModelBase<CloudType>(modelName, owner, dict, typeName, objectType),
58  outputDir_()
59 {
60  const fileName relPath =
63  /owner.name()
64  /this->modelName();
65 
66  outputDir_ = owner.mesh().time().globalPath()/relPath;
67 }
68 
69 
70 template<class CloudType>
72 (
74 )
75 :
77  outputDir_(ppm.outputDir_)
78 {}
79 
80 
81 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
82 
83 template<class CloudType>
85 {}
86 
87 
88 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
89 
90 template<class CloudType>
92 {}
93 
94 
95 template<class CloudType>
97 {
98  if (this->owner().time().writeTime())
99  {
100  this->write();
101  }
102 }
103 
104 
105 template<class CloudType>
107 (
108  typename CloudType::parcelType&,
109  const scalar,
110  const point&,
111  bool&
112 )
113 {}
114 
115 
116 template<class CloudType>
118 (
119  const typename CloudType::parcelType&,
120  const polyPatch&
121 )
122 {}
123 
124 
125 template<class CloudType>
127 (
128  const typename CloudType::parcelType&
129 )
130 {}
131 
132 
133 template<class CloudType>
135 (
136  const typename CloudType::parcelType&
137 )
138 {}
139 
140 
141 template<class CloudType>
143 {
144  return outputDir_;
145 }
146 
147 
148 template<class CloudType>
150 {
151  return outputDir_/this->owner().time().name();
152 }
153 
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 #include "CloudFunctionObjectNew.C"
158 
159 // ************************************************************************* //
Templated cloud function object base class.
virtual void postEvolve()
Post-evolve hook.
fileName writeTimeDir() const
Return the output time path.
virtual void postMove(typename CloudType::parcelType &p, const scalar dt, const point &position0, bool &keepParticle)
Post-move hook.
CloudFunctionObject(CloudType &owner)
Construct null from owner.
virtual ~CloudFunctionObject()
Destructor.
const fileName & outputDir() const
Return the output path.
virtual void postFace(const typename CloudType::parcelType &p)
Post-face hook.
virtual void preEvolve()
Pre-evolve hook.
virtual void postPatch(const typename CloudType::parcelType &p, const polyPatch &pp)
Post-patch hook.
virtual void preFace(const typename CloudType::parcelType &p)
Pre-face hook.
Base class for cloud sub-models.
const CloudType & owner() const
Return const access to the owner cloud.
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:79
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:221
const fvMesh & mesh() const
Return references to the mesh.
Definition: DSMCCloudI.H:41
const word & name() const
Return name.
Definition: IOobject.H:310
fileName globalPath() const
Return the global path.
Definition: TimePaths.H:132
static const word prefix
The prefix to local: lagrangian.
Definition: cloud.H:63
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
A class for handling file names.
Definition: fileName.H:82
word name() const
Return file name (part beyond last /)
Definition: fileName.C:195
static const word outputPrefix
Directory prefix.
Definition: writeFile.H:72
const Time & time() const
Return the top-level database.
Definition: fvMesh.H:406
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:70
const word & modelName() const
Return const access to the name of the sub-model.
Definition: subModelBase.C:104
A class for handling words, derived from string.
Definition: word.H:62
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:353
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
dictionary dict