BUG: UListIO: byteSize overflowing on really big faceLists
[OpenFOAM-2.0.x.git] / src / engine / ignition / ignitionSite.H
blobe8d3db5340019c4502fc0e76a4686011fa0c545e
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
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.
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.
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/>.
24 Class
25     Foam::ignitionSite
27 Description
28     Foam::ignitionSite
30 SourceFiles
31     ignitionSiteI.H
32     ignitionSite.C
33     ignitionSiteIO.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef ignitionSite_H
38 #define ignitionSite_H
40 #include "vector.H"
41 #include "labelList.H"
42 #include "scalarList.H"
43 #include "autoPtr.H"
44 #include "dictionary.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 namespace Foam
51 class Time;
52 class engineTime;
53 class fvMesh;
55 /*---------------------------------------------------------------------------*\
56                            Class ignitionSite Declaration
57 \*---------------------------------------------------------------------------*/
59 class ignitionSite
61     // Private data
63         const Time& db_;
64         const fvMesh& mesh_;
66         dictionary ignitionSiteDict_;
68         vector location_;
69         scalar diameter_;
70         scalar time_;
71         scalar duration_;
72         scalar strength_;
74         labelList cells_;
75         scalarList cellVolumes_;
77         //- Current time index.
78         //  Used during the update for moving meshes
79         mutable label timeIndex_;
82     // Private Member Functions
84         void findIgnitionCells(const fvMesh&);
87 public:
89     // Public classes
91         //- Class used for the read-construction of
92         //  PtrLists of ignitionSite
93         class iNew
94         {
95             const Time& db_;
96             const fvMesh& mesh_;
98         public:
100             iNew(const Time& db, const fvMesh& mesh)
101             :
102                 db_(db),
103                 mesh_(mesh)
104             {}
106             autoPtr<ignitionSite> operator()(Istream& is) const
107             {
108                 return autoPtr<ignitionSite>(new ignitionSite(is, db_, mesh_));
109             }
110         };
113     // Constructors
115         //- Construct from Istream and database
116         ignitionSite(Istream&, const Time&, const fvMesh&);
118         //- Construct from Istream and engineTime
119         ignitionSite(Istream&, const engineTime&, const fvMesh&);
121         //- Clone
122         autoPtr<ignitionSite> clone() const
123         {
124             return autoPtr<ignitionSite>(new ignitionSite(*this));
125         }
128     // Member Functions
130         // Access
132             const vector& location() const
133             {
134                 return location_;
135             }
137             scalar diameter() const
138             {
139                 return diameter_;
140             }
142             scalar time() const
143             {
144                 return time_;
145             }
147             scalar duration() const
148             {
149                 return duration_;
150             }
152             scalar strength() const
153             {
154                 return strength_;
155             }
157             //- Return the ignition cells updated if the mesh moved
158             const labelList& cells() const;
160             const scalarList& cellVolumes() const
161             {
162                 return cellVolumes_;
163             }
166         // Check
168             bool igniting() const;
170             bool ignited() const;
173     // Member Operators
175         void operator=(const ignitionSite&);
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 } // End namespace Foam
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 #endif
187 // ************************************************************************* //