|
|
|
randomise.HGo to the documentation of this file.00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 2008-2009 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 the 00013 Free Software Foundation; either version 2 of the License, or (at your 00014 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, write to the Free Software Foundation, 00023 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00024 00025 Class 00026 Foam::calcTypes::randomise 00027 00028 Description 00029 Adds a random component to a field, with a given perturbation magnitude. 00030 00031 SourceFiles 00032 randomise.C 00033 00034 \*---------------------------------------------------------------------------*/ 00035 00036 #ifndef randomise_H 00037 #define randomise_H 00038 00039 #include "calcType.H" 00040 #include "Random.H" 00041 00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00043 00044 namespace Foam 00045 { 00046 00047 namespace calcTypes 00048 { 00049 00050 /*---------------------------------------------------------------------------*\ 00051 Class randomise Declaration 00052 \*---------------------------------------------------------------------------*/ 00053 00054 class randomise 00055 : 00056 public calcType 00057 { 00058 // Private Member Functions 00059 00060 //- Disallow default bitwise copy construct 00061 randomise(const randomise&); 00062 00063 //- Disallow default bitwise assignment 00064 void operator=(const randomise&); 00065 00066 00067 protected: 00068 00069 // Member Functions 00070 00071 // Calculation routines 00072 00073 //- Initialise - typically setting static variables, 00074 // e.g. command line arguments 00075 virtual void init(); 00076 00077 //- Pre-time loop calculations 00078 virtual void preCalc 00079 ( 00080 const argList& args, 00081 const Time& runTime, 00082 const fvMesh& mesh 00083 ); 00084 00085 //- Time loop calculations 00086 virtual void calc 00087 ( 00088 const argList& args, 00089 const Time& runTime, 00090 const fvMesh& mesh 00091 ); 00092 00093 00094 // I-O 00095 00096 //- Write component fields 00097 template<class Type> 00098 void writeRandomField 00099 ( 00100 const IOobject& header, 00101 const scalar pertMag, 00102 Random& rand, 00103 const fvMesh& mesh, 00104 bool& processed 00105 ); 00106 00107 00108 public: 00109 00110 //- Runtime type information 00111 TypeName("randomise"); 00112 00113 00114 // Constructors 00115 00116 //- Construct null 00117 randomise(); 00118 00119 00120 // Destructor 00121 00122 virtual ~randomise(); 00123 }; 00124 00125 00126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00127 00128 } // End namespace calcTypes 00129 } // End namespace Foam 00130 00131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00132 00133 #ifdef NoRepository 00134 # include "writeRandomField.C" 00135 #endif 00136 00137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00138 00139 #endif 00140 00141 // ************************************************************************* // |