CloudSubModelBase.H
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-2016 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 Class
27  Foam::CloudSubModelBase
28 
29 Description
30  Base class for cloud sub-models
31 
32 SourceFiles
33  CloudSubModelBase.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef CloudSubModelBase_H
38 #define CloudSubModelBase_H
39 
40 #include "subModelBase.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class CloudSubModelBase Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 template<class CloudType>
53 :
54  public subModelBase
55 {
56 protected:
57 
58  // Protected Data
59 
60  //- Reference to the cloud
62 
63 
64 public:
65 
66  // Constructors
67 
68  //- Construct null from owner cloud
70 
71  //- Construct from owner cloud without name
73  (
75  const dictionary& dict,
76  const word& baseName,
77  const word& modelType,
78  const word& dictExt = "Coeffs"
79  );
80 
81  //- Construct from owner cloud with name
83  (
84  const word& modelName,
86  const dictionary& dict,
87  const word& baseName,
88  const word& modelType
89  );
90 
91  //- Construct as copy
93 
94 
95  //- Destructor
96  virtual ~CloudSubModelBase();
97 
98  //- Type of cloud this model was instantiated for
99  typedef CloudType cloudType;
100 
101 
102  // Member Functions
103 
104  // Access
105 
106  //- Return const access to the owner cloud
107  const CloudType& owner() const;
108 
109  //- Flag to indicate when to write a property
110  virtual bool writeTime() const;
111 
112  //- Output directory
113  virtual fileName localPath() const;
114 
115 
116  // Edit
117 
118  //- Return non-const access to the owner cloud for manipulation
119  CloudType& owner();
120 
121 
122  // I-O
123 
124  //- Write
125  virtual void write(Ostream& os) const;
126 };
127 
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 } // End namespace Foam
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 #ifdef NoRepository
136  #include "CloudSubModelBase.C"
137 #endif
138 
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 
141 #endif
142 
143 // ************************************************************************* //
Foam::subModelBase
Base class for generic sub-models requiring to be read from dictionary. Provides a mechanism to read ...
Definition: subModelBase.H:54
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::CloudSubModelBase::CloudSubModelBase
CloudSubModelBase(CloudType &owner)
Construct null from owner cloud.
Definition: CloudSubModelBase.C:34
Foam::CloudSubModelBase
Base class for cloud sub-models.
Definition: CloudSubModelBase.H:51
Foam::CloudSubModelBase::~CloudSubModelBase
virtual ~CloudSubModelBase()
Destructor.
Definition: CloudSubModelBase.C:99
subModelBase.H
Foam::subModelBase::modelName
const word & modelName() const
Return const access to the name of the sub-model.
Definition: subModelBase.C:107
Foam::CloudSubModelBase::owner_
CloudType & owner_
Reference to the cloud.
Definition: CloudSubModelBase.H:60
Foam::subModelBase::dict
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:113
Foam::CloudSubModelBase::owner
const CloudType & owner() const
Return const access to the owner cloud.
Definition: CloudSubModelBase.C:106
Foam::DSMCCloud
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:71
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
os
OBJstream os(runTime.globalPath()/outputName)
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::subModelBase::modelType
const word & modelType() const
Return const access to the sub-model type.
Definition: subModelBase.C:125
Foam::CloudSubModelBase::write
virtual void write(Ostream &os) const
Write.
Definition: CloudSubModelBase.C:142
Foam::CloudSubModelBase::cloudType
CloudType cloudType
Type of cloud this model was instantiated for.
Definition: CloudSubModelBase.H:98
Foam::CloudSubModelBase::localPath
virtual fileName localPath() const
Output directory.
Definition: CloudSubModelBase.C:130
CloudSubModelBase.C
Foam::subModelBase::baseName
const word & baseName() const
Return const access to the base name of the sub-model.
Definition: subModelBase.C:119
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::CloudSubModelBase::writeTime
virtual bool writeTime() const
Flag to indicate when to write a property.
Definition: CloudSubModelBase.C:120