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 -------------------------------------------------------------------------------
11 License
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 
34 template<class CloudType>
36 {
38 }
39 
40 
41 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
42 
43 template<class CloudType>
45 :
47  outputDir_()
48 {}
49 
50 
51 template<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 
77 template<class CloudType>
79 (
81 )
82 :
84  outputDir_(ppm.outputDir_)
85 {}
86 
87 
88 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
89 
90 template<class CloudType>
92 (
93  const typename parcelType::trackingData& td
94 )
95 {}
96 
97 
98 template<class CloudType>
100 (
101  const typename parcelType::trackingData& td
102 )
103 {
104  if (this->owner().time().writeTime())
105  {
106  this->write();
107  }
108 }
109 
110 
111 template<class CloudType>
113 (
114  parcelType&,
115  const scalar,
116  const point&,
117  bool&
118 )
119 {}
120 
121 
122 template<class CloudType>
124 (
125  const parcelType&,
126  const polyPatch&,
127  bool&
128 )
129 {}
130 
131 
132 template<class CloudType>
134 (
135  const parcelType&,
136  bool&
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().timeName();
152 }
153 
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 #include "CloudFunctionObjectNew.C"
158 
159 // ************************************************************************* //
Foam::CloudFunctionObject::postFace
virtual void postFace(const parcelType &p, bool &keepParticle)
Post-face hook.
Definition: CloudFunctionObject.C:134
Foam::CloudFunctionObject::postEvolve
virtual void postEvolve(const typename parcelType::trackingData &td)
Post-evolve hook.
Definition: CloudFunctionObject.C:100
Foam::CloudFunctionObject::postMove
virtual void postMove(parcelType &p, const scalar dt, const point &position0, bool &keepParticle)
Post-move hook.
Definition: CloudFunctionObject.C:113
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::fileName
A class for handling file names.
Definition: fileName.H:73
Foam::CloudFunctionObject::CloudFunctionObject
CloudFunctionObject(CloudType &owner)
Construct null from owner.
Definition: CloudFunctionObject.C:44
Foam::CloudSubModelBase
Base class for cloud sub-models.
Definition: CloudSubModelBase.H:51
CloudFunctionObject.H
NotImplemented
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:517
Foam::DSMCCloud::mesh
const fvMesh & mesh() const
Return reference to the mesh.
Definition: DSMCCloudI.H:44
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:68
Foam::functionObject::outputPrefix
static word outputPrefix
Directory prefix.
Definition: functionObject.H:376
Foam::DSMCCloud
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:71
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::CloudFunctionObject::preEvolve
virtual void preEvolve(const typename parcelType::trackingData &td)
Pre-evolve hook.
Definition: CloudFunctionObject.C:92
Foam::CloudFunctionObject::postPatch
virtual void postPatch(const parcelType &p, const polyPatch &pp, bool &keepParticle)
Post-patch hook.
Definition: CloudFunctionObject.C:124
Foam::Vector< scalar >
Foam::CloudFunctionObject::writeTimeDir
fileName writeTimeDir() const
Return the output time path.
Definition: CloudFunctionObject.C:149
Foam::CloudFunctionObject
Templated cloud function object base class.
Definition: CloudFunctionObject.H:62
Foam::vtk::write
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
Definition: foamVtkOutputTemplates.C:36
Foam::TimePaths::globalPath
fileName globalPath() const
Return global path for the case.
Definition: TimePathsI.H:80
Foam::fvMesh::time
const Time & time() const
Return the top-level database.
Definition: fvMesh.H:280
functionObject.H
Foam::CloudFunctionObject::outputDir
const fileName & outputDir() const
Return the output path.
Definition: CloudFunctionObject.C:142
CloudFunctionObjectNew.C