00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. 00006 \\/ M anipulation | 00007 ------------------------------------------------------------------------------- 00008 License 00009 This file is part of OpenFOAM. 00010 00011 OpenFOAM is free software: you can redistribute it and/or modify it 00012 under the terms of the GNU General Public License as published by 00013 the Free Software Foundation, either version 3 of the License, or 00014 (at your option) any later version. 00015 00016 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT 00017 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00018 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00019 for more details. 00020 00021 You should have received a copy of the GNU General Public License 00022 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. 00023 00024 Class 00025 Foam::basicSourceList 00026 00027 Description 00028 List of explict sources 00029 00030 SourceFile 00031 basicSourceList.C 00032 00033 \*---------------------------------------------------------------------------*/ 00034 00035 #ifndef basicSourceList_H 00036 #define basicSourceList_H 00037 00038 #include <OpenFOAM/PtrList.H> 00039 #include <OpenFOAM/DimensionedField.H> 00040 #include "basicSource.H" 00041 00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00043 00044 namespace Foam 00045 { 00046 00047 /*---------------------------------------------------------------------------*\ 00048 Class basicSourceList Declaration 00049 \*---------------------------------------------------------------------------*/ 00050 00051 class basicSourceList 00052 : 00053 public PtrList<basicSource> 00054 { 00055 private: 00056 00057 // Private data 00058 00059 //- Reference to the mesh database 00060 const fvMesh& mesh_; 00061 00062 00063 // Private Member Functions 00064 00065 //- Disallow default bitwise copy construct 00066 basicSourceList(const basicSourceList&); 00067 00068 //- Disallow default bitwise assignment 00069 void operator=(const basicSourceList&); 00070 00071 00072 public: 00073 00074 // Constructors 00075 00076 //- Construct from components with list of field names 00077 basicSourceList(const fvMesh& mesh, const dictionary& dict); 00078 00079 00080 //- Destructor 00081 virtual ~basicSourceList() 00082 {} 00083 00084 00085 // Member Functions 00086 00087 // Evaluation 00088 00089 //- Add all explicit sources 00090 void addExplicitSources(); 00091 00092 //- Add source to scalar field 00093 void addSu(DimensionedField<scalar, volMesh>& field); 00094 00095 //- Add source to vector field 00096 void addSu(DimensionedField<vector, volMesh>& field); 00097 00098 //- Add source terms to scalar fvMatrix 00099 void addSu(fvMatrix<scalar>& Eq); 00100 00101 //- Add source terms to vector fvMatrix 00102 void addSu(fvMatrix<vector>& Eq); 00103 00104 00105 // I-O 00106 00107 //- Read dictionary 00108 virtual bool read(const dictionary& dict); 00109 00110 //- Write data to Istream 00111 virtual bool writeData(Ostream& os) const; 00112 00113 //- Ostream operator 00114 friend Ostream& operator<< 00115 ( 00116 Ostream& os, 00117 const basicSourceList& sources 00118 ); 00119 00120 }; 00121 00122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00123 00124 } // End namespace Foam 00125 00126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00127 00128 #endif 00129 00130 // ************************************************************************* //