Loading...
Searching...
No Matches
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>
35void Foam::CloudFunctionObject<CloudType>::write()
36{
38}
39
40
41// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
42
43template<class CloudType>
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 (
68 owner.mesh().time().globalPath()
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>
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())
106 this->write();
107 }
108}
109
110
111template<class CloudType>
113(
114 parcelType&,
115 const scalar,
116 const point&,
117 const typename parcelType::trackingData& td
120 return true;
121}
122
123
124template<class CloudType>
126(
127 const parcelType&,
128 const polyPatch&,
129 const typename parcelType::trackingData& td
131{
132 return true;
133}
134
135
136template<class CloudType>
138(
139 const parcelType&,
140 const typename parcelType::trackingData& td
142{
143 return true;
144}
145
146
147template<class CloudType>
149{
150 return outputDir_;
151}
152
153
154template<class CloudType>
156{
157 return outputDir_/this->owner().time().timeName();
158}
159
160
161// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162
164
165// ************************************************************************* //
Templated cloud function object base class.
fileName writeTimeDir() const
Return the output time path.
CloudFunctionObject(CloudType &owner)
Construct null from owner.
const fileName & outputDir() const
Return the output path.
virtual void postEvolve(const typename parcelType::trackingData &td)
Post-evolve hook.
virtual void preEvolve(const typename parcelType::trackingData &td)
Pre-evolve hook.
virtual bool postMove(parcelType &p, const scalar dt, const point &position0, const typename parcelType::trackingData &td)
Post-move hook.
virtual bool postFace(const parcelType &p, const typename parcelType::trackingData &td)
Post-face hook.
virtual bool postPatch(const parcelType &p, const polyPatch &pp, const typename parcelType::trackingData &td)
Post-patch hook.
Base class for cloud sub-models.
virtual fileName localPath() const
Output directory.
const CloudType & owner() const
Return const access to the owner cloud.
CloudSubModelBase(CloudType &owner)
Construct null from owner cloud.
virtual bool writeTime() const
Flag to indicate when to write a property.
const fvMesh & mesh() const
Return reference to the mesh.
Definition DSMCCloudI.H:37
particle::trackingData trackingData
Definition DSMCParcel.H:155
static word timeName(const scalar t, const int precision=precision_)
Return a time name for the given scalar time value formatted with the given precision.
Definition Time.C:714
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
A class for handling file names.
Definition fileName.H:75
static bool clean(std::string &str)
Cleanup filename string, possibly applies other transformations such as changing the path separator e...
Definition fileName.C:192
static word outputPrefix
Directory prefix.
const Time & time() const noexcept
Return time registry.
A patch is a list of labels that address the faces in the global face list.
Definition polyPatch.H:73
const dictionary & dict() const
Return const access to the cloud dictionary.
const word & modelName() const
Return const access to the name of the sub-model.
A class for handling words, derived from Foam::string.
Definition word.H:66
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition error.H:688
wallPoints::trackData td(isBlockedFace, regionToBlockSize)
DSMCCloud< dsmcParcel > CloudType
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
vector point
Point is a vector.
Definition point.H:37
runTime write()
dictionary dict