FreeFOAM The Cross-Platform CFD Toolkit
TimeActivatedExplicitSourceList.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 | Copyright (C) 2010-2010 OpenCFD Ltd.
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 Class
25  Foam::TimeActivatedExplicitSourceList
26 
27 Description
28  List of time activeted explict sources
29 
30 SourceFiles
31  TimeActivatedExplicitSourceList.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef TimeActivatedExplicitSourceList_H
36 #define TimeActivatedExplicitSourceList_H
37 
38 #include <OpenFOAM/IOPtrList.H>
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 // Forward declaration of classes
47 class fvMesh;
48 
49 template<class Type>
50 class TimeActivatedExplicitSource;
51 
52 template<class Type>
53 class TimeActivatedExplicitSourceList;
54 
55 // Forward declaration of friend functions
56 
57 template<class Type>
58 Ostream& operator<<
59 (
60  Ostream&,
61  const TimeActivatedExplicitSourceList<Type>&
62 );
63 
64 /*---------------------------------------------------------------------------*\
65  Class TimeActivatedExplicitSourceList Declaration
66 \*---------------------------------------------------------------------------*/
67 
68 template<class Type>
70 :
71  public IOPtrList<TimeActivatedExplicitSource<Type> >
72 {
73 private:
74 
75  // Private data
76 
77  //- Name of source properties list
78  word name_;
79 
80  //- Reference to the mesh database
81  const fvMesh& mesh_;
82 
83  //- Dimensions of source properties
84  dimensionSet dimensions_;
85 
86  //- List of field names the source is working on
87  wordList fieldNames_;
88 
89 
90  // Private Member Functions
91 
92  //- Disallow default bitwise copy construct
94  (
96  );
97 
98  //- Disallow default bitwise assignment
99  void operator=(const TimeActivatedExplicitSourceList<Type>&);
100 
101 
102 public:
103 
104  // Constructors
105 
106  //- Construct from components with list of field names
108  (
109  const word& name,
110  const fvMesh& mesh,
111  const dimensionSet& dimensions,
112  const wordList& fieldNames
113  );
114 
115  //- Construct from components with single field name
117  (
118  const word& name,
119  const fvMesh& mesh,
120  const dimensionSet& dimensions,
121  const word& fieldName
122  );
123 
124 
125  // Member Functions
126 
127  // Evaluation
128 
129  //- Return the source for field, fieldI
131  (
132  const label fieldI = 0
133  );
134 
135  //- Return the total source for all fields
137 
138 
139 
140  // I-O
141 
142  //- Read data from Istream
143  bool readData(Istream& is);
144 
145  //- Write data to Istream
146  bool writeData(Ostream& os) const;
147 
148  //- Ostream operator
149  friend Ostream& operator<< <Type>
150  (
151  Ostream& os,
152  const TimeActivatedExplicitSourceList& sources
153  );
154 };
155 
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 } // End namespace Foam
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 #ifdef NoRepository
165 #endif
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 #endif
170 
171 // ************************ vim: set sw=4 sts=4 et: ************************ //