OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

calcType.H

Go 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) 1991-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 Namespace
00026     Foam::calcTypes
00027 
00028 Description
00029     Namespace for post-processing calculation functions
00030 
00031 
00032 Class
00033     Foam::calcType
00034 
00035 Description
00036     Base class for post-processing calculation functions
00037 
00038 SourceFiles
00039     calcType.C
00040 
00041 \*---------------------------------------------------------------------------*/
00042 
00043 #ifndef calcType_H
00044 #define calcType_H
00045 
00046 #include "autoPtr.H"
00047 #include "runTimeSelectionTables.H"
00048 
00049 #include "fvCFD.H"
00050 
00051 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00052 
00053 namespace Foam
00054 {
00055 
00056 /*---------------------------------------------------------------------------*\
00057                           Class calcType Declaration
00058 \*---------------------------------------------------------------------------*/
00059 
00060 class calcType
00061 {
00062     // Private Member Functions
00063 
00064         //- Disallow default bitwise copy construct
00065         calcType(const calcType&);
00066 
00067         //- Disallow default bitwise assignment
00068         void operator=(const calcType&);
00069 
00070 
00071 protected:
00072 
00073     // Protected member functions
00074 
00075         // Calculation routines
00076 
00077             //- Initialise - typically setting static variables,
00078             //  e.g. command line arguments
00079             virtual void init();
00080 
00081             //- Pre-time loop calculations
00082             virtual void preCalc
00083             (
00084                 const argList& args,
00085                 const Time& runTime,
00086                 const fvMesh& mesh
00087             );
00088 
00089             //- Time loop calculations
00090             virtual void calc
00091             (
00092                 const argList& args,
00093                 const Time& runTime,
00094                 const fvMesh& mesh
00095             );
00096 
00097             //- Post-time loop calculations
00098             virtual void postCalc
00099             (
00100                 const argList& args,
00101                 const Time& runTime,
00102                 const fvMesh& mesh
00103             );
00104 
00105 
00106 public:
00107 
00108     //- Runtime type information
00109     TypeName("calcType");
00110 
00111 
00112     // Declare runtime constructor selection table
00113 
00114         declareRunTimeSelectionTable
00115         (
00116             autoPtr,
00117             calcType,
00118             dictionary,
00119             (),
00120             ()
00121         );
00122 
00123 
00124     // Constructors
00125 
00126         //- Construct null
00127         calcType();
00128 
00129 
00130     // Selectors
00131 
00132         static autoPtr<calcType> New(const word& calcTypeName);
00133 
00134 
00135     // Destructor
00136 
00137         virtual ~calcType();
00138 
00139 
00140     // Member Functions
00141 
00142         // Calculation routines - wrapped by exception handling loop
00143 
00144             //- Initialise - typically setting static variables,
00145             //  e.g. command line arguments
00146             void tryInit();
00147 
00148             //- Pre-time loop calculations
00149             void tryPreCalc
00150             (
00151                 const argList& args,
00152                 const Time& runTime,
00153                 const fvMesh& mesh
00154             );
00155 
00156             //- Time loop calculations
00157             void tryCalc
00158             (
00159                 const argList& args,
00160                 const Time& runTime,
00161                 const fvMesh& mesh
00162             );
00163 
00164             //- Post-time loop calculations
00165             void tryPostCalc
00166             (
00167                 const argList& args,
00168                 const Time& runTime,
00169                 const fvMesh& mesh
00170             );
00171 };
00172 
00173 
00174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00175 
00176 } // End namespace Foam
00177 
00178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00179 
00180 #endif
00181 
00182 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd