CloudFunctionObject.C
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2019 OpenFOAM Foundation
9 Copyright (C) 2020 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27\*---------------------------------------------------------------------------*/
28
29#include "CloudFunctionObject.H"
30#include "functionObject.H"
31
32// * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * //
33
34template<class CloudType>
36{
38}
39
40
41// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
42
43template<class CloudType>
45:
47 outputDir_()
48{}
49
50
51template<class CloudType>
53(
54 const dictionary& dict,
55 CloudType& owner,
56 const word& modelName,
57 const word& objectType
58)
59:
60 CloudSubModelBase<CloudType>(modelName, owner, dict, typeName, objectType),
61 outputDir_()
62{
63 // Put in undecomposed case
64 // (Note: gives problems for distributed data running)
65
66 outputDir_ =
67 (
70 / this->localPath()
71 );
72
73 outputDir_.clean(); // Remove unneeded ".."
74}
75
76
77template<class CloudType>
79(
81)
82:
84 outputDir_(ppm.outputDir_)
85{}
86
87
88// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
89
90template<class CloudType>
92(
93 const typename parcelType::trackingData& td
94)
95{}
96
97
98template<class CloudType>
100(
101 const typename parcelType::trackingData& td
102)
103{
104 if (this->owner().time().writeTime())
105 {
106 this->write();
107 }
108}
110
111template<class CloudType>
113(
114 parcelType&,
115 const scalar,
116 const point&,
117 bool&
118)
119{}
120
122template<class CloudType>
124(
125 const parcelType&,
126 const polyPatch&,
127 bool&
128)
129{}
130
131
132template<class CloudType>
134(
135 const parcelType&,
136 bool&
137)
138{}
139
140
141template<class CloudType>
143{
144 return outputDir_;
145}
146
147
148template<class CloudType>
150{
151 return outputDir_/this->owner().time().timeName();
153
154
155// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156
158
159// ************************************************************************* //
Templated cloud function object base class.
fileName writeTimeDir() const
Return the output time path.
virtual void postMove(parcelType &p, const scalar dt, const point &position0, bool &keepParticle)
Post-move hook.
virtual void postPatch(const parcelType &p, const polyPatch &pp, bool &keepParticle)
Post-patch hook.
const fileName & outputDir() const
Return the output path.
virtual void preEvolve(const typename parcelType::trackingData &td)
Pre-evolve hook.
virtual void postFace(const parcelType &p, bool &keepParticle)
Post-face hook.
Base class for cloud sub-models.
virtual fileName localPath() const
Output directory.
const CloudType & owner() const
Return const access to the owner cloud.
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:75
const fvMesh & mesh() const
Return reference to the mesh.
Definition: DSMCCloudI.H:44
virtual void postEvolve()
Post-evolve hook.
fileName globalPath() const
Return global path for the case.
Definition: TimePathsI.H:80
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Class used to pass data into container.
A class for handling file names.
Definition: fileName.H:76
static bool clean(std::string &str)
Definition: fileName.C:199
static word outputPrefix
Directory prefix.
const Time & time() const
Return the top-level database.
Definition: fvMesh.H:290
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:75
A class for handling words, derived from Foam::string.
Definition: word.H:68
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:517
runTime write()
dictionary dict