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 | Copyright (C) 2011-2015 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 
28 // * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * //
29 
30 template<class CloudType>
32 {
34 }
35 
36 
37 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
38 
39 template<class CloudType>
41 :
43  outputDir_()
44 {}
45 
46 
47 template<class CloudType>
49 (
50  const dictionary& dict,
51  CloudType& owner,
52  const word& modelName,
53  const word& objectType
54 )
55 :
56  CloudSubModelBase<CloudType>(modelName, owner, dict, typeName, objectType),
57  outputDir_(owner.mesh().time().path())
58 {
59  const fileName relPath =
60  "postProcessing"/cloud::prefix/owner.name()/this->modelName();
61 
62 
63  if (Pstream::parRun())
64  {
65  // Put in undecomposed case (Note: gives problems for
66  // distributed data running)
67  outputDir_ = outputDir_/".."/relPath;
68  }
69  else
70  {
71  outputDir_ = outputDir_/relPath;
72  }
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  // do nothing
100 }
101 
102 
103 template<class CloudType>
105 {
106  if (this->owner().time().outputTime())
107  {
108  this->write();
109  }
110 }
111 
112 
113 template<class CloudType>
115 (
116  typename CloudType::parcelType&,
117  const label,
118  const scalar,
119  const point&,
120  bool&
121 )
122 {
123  // do nothing
124 }
125 
126 
127 template<class CloudType>
129 (
130  const typename CloudType::parcelType&,
131  const polyPatch&,
132  const scalar,
133  const tetIndices&,
134  bool&
135 )
136 {
137  // do nothing
138 }
139 
140 
141 template<class CloudType>
143 (
144  const typename CloudType::parcelType&,
145  const label,
146  bool&
147 )
148 {
149  // do nothing
150 }
151 
152 
153 template<class CloudType>
155 {
156  return outputDir_;
157 }
158 
159 
160 template<class CloudType>
162 {
163  return outputDir_/this->owner().time().timeName();
164 }
165 
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 #include "CloudFunctionObjectNew.C"
170 
171 // ************************************************************************* //
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
Foam::CloudFunctionObject::outputDir_
fileName outputDir_
Output path.
Definition: CloudFunctionObject.H:63
Foam::CloudFunctionObject::CloudFunctionObject
CloudFunctionObject(CloudType &owner)
Construct null from owner.
Definition: CloudFunctionObject.C:40
Foam::UPstream::parRun
static bool & parRun()
Is this a parallel run?
Definition: UPstream.H:377
Foam::CloudSubModelBase
Base class for cloud sub-models.
Definition: CloudSubModelBase.H:49
Foam::CloudFunctionObject::~CloudFunctionObject
virtual ~CloudFunctionObject()
Destructor.
Definition: CloudFunctionObject.C:90
CloudFunctionObject.H
Foam::CloudFunctionObject::write
virtual void write()
Write post-processing info.
Definition: CloudFunctionObject.C:31
NotImplemented
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:365
Foam::CloudFunctionObject::outputTimeDir
fileName outputTimeDir() const
Return the output time path.
Definition: CloudFunctionObject.C:161
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Foam::DSMCCloud::mesh
const fvMesh & mesh() const
Return refernce to the mesh.
Definition: DSMCCloudI.H:41
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
Foam::DSMCCloud
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:68
Foam::CloudFunctionObject::postPatch
virtual void postPatch(const typename CloudType::parcelType &p, const polyPatch &pp, const scalar trackFraction, const tetIndices &testIs, bool &keepParticle)
Post-patch hook.
Definition: CloudFunctionObject.C:129
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::CloudFunctionObject::postEvolve
virtual void postEvolve()
Post-evolve hook.
Definition: CloudFunctionObject.C:104
Foam::cloud::prefix
static const word prefix
The prefix to local: lagrangian.
Definition: cloud.H:71
Foam::tetIndices
Storage and named access for the indices of a tet which is part of the decomposition of a cell.
Definition: tetIndices.H:73
Foam::CloudFunctionObject::postFace
virtual void postFace(const typename CloudType::parcelType &p, const label faceI, bool &keepParticle)
Post-face hook.
Definition: CloudFunctionObject.C:143
Foam::Time::path
fileName path() const
Return path.
Definition: Time.H:281
Foam::Vector< scalar >
Foam::CloudFunctionObject
Templated cloud function object base class.
Definition: CloudFunctionObject.H:56
Foam::fvMesh::time
const Time & time() const
Return the top-level database.
Definition: fvMesh.H:243
Foam::CloudFunctionObject::postMove
virtual void postMove(typename CloudType::parcelType &p, const label cellI, const scalar dt, const point &position0, bool &keepParticle)
Post-move hook.
Definition: CloudFunctionObject.C:115
Foam::DSMCCloud::parcelType
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:217
Foam::CloudFunctionObject::preEvolve
virtual void preEvolve()
Pre-evolve hook.
Definition: CloudFunctionObject.C:97
write
Tcoeff write()
Foam::CloudFunctionObject::outputDir
const fileName & outputDir() const
Return the output path.
Definition: CloudFunctionObject.C:154
CloudFunctionObjectNew.C