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 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
28 #include "CloudFunctionObject.H"
29 #include "functionObject.H"
30 
31 // * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * //
32 
33 template<class CloudType>
35 {
37 }
38 
39 
40 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
41 
42 template<class CloudType>
44 :
46  outputDir_()
47 {}
48 
49 
50 template<class CloudType>
52 (
53  const dictionary& dict,
54  CloudType& owner,
55  const word& modelName,
56  const word& objectType
57 )
58 :
59  CloudSubModelBase<CloudType>(modelName, owner, dict, typeName, objectType),
60  outputDir_()
61 {
62  // Put in undecomposed case
63  // (Note: gives problems for distributed data running)
64 
65  outputDir_ =
66  (
67  owner.mesh().time().globalPath()
69  / this->localPath()
70  );
71 
72  outputDir_.clean(); // Remove unneeded ".."
73 }
74 
75 
76 template<class CloudType>
78 (
80 )
81 :
83  outputDir_(ppm.outputDir_)
84 {}
85 
86 
87 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
88 
89 template<class CloudType>
91 {}
92 
93 
94 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
95 
96 template<class CloudType>
98 {}
99 
100 
101 template<class CloudType>
103 {
104  if (this->owner().time().writeTime())
105  {
106  this->write();
107  }
108 }
109 
110 
111 template<class CloudType>
113 (
114  typename CloudType::parcelType&,
115  const scalar,
116  const point&,
117  bool&
118 )
119 {}
120 
121 
122 template<class CloudType>
124 (
125  const typename CloudType::parcelType&,
126  const polyPatch&,
127  bool&
128 )
129 {}
130 
131 
132 template<class CloudType>
134 (
135  const typename CloudType::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::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
Foam::CloudFunctionObject::postMove
virtual void postMove(typename CloudType::parcelType &p, const scalar dt, const point &position0, bool &keepParticle)
Post-move hook.
Definition: CloudFunctionObject.C:113
Foam::CloudFunctionObject::CloudFunctionObject
CloudFunctionObject(CloudType &owner)
Construct null from owner.
Definition: CloudFunctionObject.C:43
Foam::CloudSubModelBase
Base class for cloud sub-models.
Definition: CloudSubModelBase.H:51
Foam::CloudFunctionObject::~CloudFunctionObject
virtual ~CloudFunctionObject()
Destructor.
Definition: CloudFunctionObject.C:90
CloudFunctionObject.H
NotImplemented
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:419
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:66
Foam::functionObject::outputPrefix
static word outputPrefix
Directory prefix.
Definition: functionObject.H:259
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:121
Foam::CloudFunctionObject::postEvolve
virtual void postEvolve()
Post-evolve hook.
Definition: CloudFunctionObject.C:102
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:61
Foam::CloudFunctionObject::postPatch
virtual void postPatch(const typename CloudType::parcelType &p, const polyPatch &pp, bool &keepParticle)
Post-patch hook.
Definition: CloudFunctionObject.C:124
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:35
Foam::TimePaths::globalPath
fileName globalPath() const
Return global path for the case.
Definition: TimePathsI.H:72
Foam::fvMesh::time
const Time & time() const
Return the top-level database.
Definition: fvMesh.H:246
Foam::DSMCCloud::parcelType
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:220
Foam::CloudFunctionObject::preEvolve
virtual void preEvolve()
Pre-evolve hook.
Definition: CloudFunctionObject.C:97
functionObject.H
Foam::CloudFunctionObject::outputDir
const fileName & outputDir() const
Return the output path.
Definition: CloudFunctionObject.C:142
CloudFunctionObjectNew.C
Foam::CloudFunctionObject::postFace
virtual void postFace(const typename CloudType::parcelType &p, bool &keepParticle)
Post-face hook.
Definition: CloudFunctionObject.C:134