FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

TimePaths.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-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::TimePaths
00026 
00027 Description
00028     A class for addressing time paths without using the Time class.
00029 
00030 SourceFiles
00031     TimePaths.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef TimePaths_H
00036 #define TimePaths_H
00037 
00038 #include <OpenFOAM/fileName.H>
00039 
00040 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00041 
00042 namespace Foam
00043 {
00044 
00045 /*---------------------------------------------------------------------------*\
00046                            Class TimePaths Declaration
00047 \*---------------------------------------------------------------------------*/
00048 
00049 
00050 class TimePaths
00051 {
00052     // Private data
00053 
00054         bool processorCase_;
00055         fileName rootPath_;
00056         fileName case_;
00057         word system_;
00058         word constant_;
00059 
00060 
00061 public:
00062 
00063     // Constructors
00064 
00065         //- Construct given database name, rootPath and casePath
00066         TimePaths
00067         (
00068             const fileName& rootPath,
00069             const fileName& caseName,
00070             const word& systemName,
00071             const word& constantName
00072         );
00073 
00074 
00075     // Member functions
00076 
00077             //- Return true if this is a processor case
00078             bool processorCase() const
00079             {
00080                 return processorCase_;
00081             }
00082 
00083             //- Return root path
00084             const fileName& rootPath() const
00085             {
00086                 return rootPath_;
00087             }
00088 
00089             //- Return case name
00090             const fileName& caseName() const
00091             {
00092                 return case_;
00093             }
00094 
00095             //- Return system name
00096             const word& system() const
00097             {
00098                 return system_;
00099             }
00100 
00101             //- Return system name for the case
00102             //  which for parallel runs returns ../system()
00103             fileName caseSystem() const;
00104 
00105             //- Return constant name
00106             const word& constant() const
00107             {
00108                 return constant_;
00109             }
00110 
00111             //- Return constant name for the case
00112             //  which for parallel runs returns ../constant()
00113             fileName caseConstant() const;
00114 
00115             //- Return path
00116             fileName path() const
00117             {
00118                 return rootPath()/caseName();
00119             }
00120 
00121             //- Return system path
00122             fileName systemPath() const
00123             {
00124                 return path()/system();
00125             }
00126 
00127             //- Return constant path
00128             fileName constantPath() const
00129             {
00130                 return path()/constant();
00131             }
00132 };
00133 
00134 
00135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00136 
00137 } // End namespace Foam
00138 
00139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00140 
00141 #endif
00142 
00143 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines