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

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