Transferred copyright to the OpenFOAM Foundation
[OpenFOAM-2.0.x.git] / src / finiteVolume / cfdTools / general / fieldSources / timeActivatedExplicitSource / TimeActivatedExplicitSourceList.H
blob228d3127330a07a8450b0223d2559e1b0c533e91
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::TimeActivatedExplicitSourceList
27 Description
28     List of time activeted explict sources
30 SourceFiles
31     TimeActivatedExplicitSourceList.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef TimeActivatedExplicitSourceList_H
36 #define TimeActivatedExplicitSourceList_H
38 #include "IOPtrList.H"
39 #include "TimeActivatedExplicitSource.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 namespace Foam
46 // Forward declaration of classes
47 class fvMesh;
49 template<class Type>
50 class TimeActivatedExplicitSource;
52 template<class Type>
53 class TimeActivatedExplicitSourceList;
55 // Forward declaration of friend functions
57 template<class Type>
58 Ostream& operator<<
60     Ostream&,
61     const TimeActivatedExplicitSourceList<Type>&
64 /*---------------------------------------------------------------------------*\
65              Class TimeActivatedExplicitSourceList Declaration
66 \*---------------------------------------------------------------------------*/
68 template<class Type>
69 class TimeActivatedExplicitSourceList
71     public IOPtrList<TimeActivatedExplicitSource<Type> >
73 private:
75     // Private data
77         //- Name of source properties list
78         word name_;
80         //- Reference to the mesh database
81         const fvMesh& mesh_;
83         //- Dimensions of source properties
84         dimensionSet dimensions_;
86         //- List of field names the source is working on
87         wordList fieldNames_;
90     // Private Member Functions
92         //- Disallow default bitwise copy construct
93         TimeActivatedExplicitSourceList
94         (
95             const TimeActivatedExplicitSourceList<Type>&
96         );
98         //- Disallow default bitwise assignment
99         void operator=(const TimeActivatedExplicitSourceList<Type>&);
102 public:
104     // Constructors
106         //- Construct from components with list of field names
107         TimeActivatedExplicitSourceList
108         (
109             const word& name,
110             const fvMesh& mesh,
111             const dimensionSet& dimensions,
112             const wordList& fieldNames
113         );
115         //- Construct from components with single field name
116         TimeActivatedExplicitSourceList
117         (
118             const word& name,
119             const fvMesh& mesh,
120             const dimensionSet& dimensions,
121             const word& fieldName
122         );
125     // Member Functions
127         // Evaluation
129             //- Return the source for field, fieldI
130             tmp<DimensionedField<Type, volMesh> > Su
131             (
132                 const label fieldI = 0
133             );
135             //- Return the total source for all fields
136             tmp<DimensionedField<Type, volMesh> > SuTot();
140         // I-O
142             //- Read data from Istream
143             bool readData(Istream& is);
145             //- Write data to Istream
146             bool writeData(Ostream& os) const;
148             //- Ostream operator
149             friend Ostream& operator<< <Type>
150             (
151                 Ostream& os,
152                 const TimeActivatedExplicitSourceList& sources
153             );
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 } // End namespace Foam
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 #ifdef NoRepository
164 #   include "TimeActivatedExplicitSourceList.C"
165 #endif
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 #endif
171 // ************************************************************************* //