00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 1991-2005 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00024 00025 Class 00026 twoWayFiles 00027 00028 Description 00029 two way DEM-CFD coupling via files 00030 00031 \*---------------------------------------------------------------------------*/ 00032 00033 #ifndef twoWayFiles_H 00034 #define twoWayFiles_H 00035 00036 #include "dataExchangeModel.H" 00037 #include "OFstream.H" 00038 #include "sys/stat.h" 00039 00040 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00041 00042 namespace Foam 00043 { 00044 00045 /*---------------------------------------------------------------------------*\ 00046 Class twoWayFiles Declaration 00047 \*---------------------------------------------------------------------------*/ 00048 00049 class twoWayFiles 00050 : 00051 public dataExchangeModel 00052 { 00053 private: 00054 00055 // private data 00056 dictionary propsDict_; 00057 00058 // private member functions 00059 00060 const char* wordToChar(word&) const; 00061 00062 const char* fileNameToChar(fileName&) const; 00063 00064 fileName getFilePath(word&, bool) const; 00065 00066 void renameFilePath(fileName&,word&) const; 00067 00068 public: 00069 00070 //- Runtime type information 00071 TypeName("twoWayFiles"); 00072 00073 00074 // Constructors 00075 00076 //- Construct from components 00077 twoWayFiles 00078 ( 00079 const dictionary& dict, 00080 cfdemCloud& sm 00081 ); 00082 00083 // Destructor 00084 00085 ~twoWayFiles(); 00086 00087 00088 // Member Functions 00089 void getData 00090 ( 00091 word name, 00092 word type, 00093 double ** const& field, 00094 label step 00095 ) const; 00096 00097 void getData 00098 ( 00099 word name, 00100 word type, 00101 int ** const& field, 00102 label step 00103 ) const {FatalError<<"function not implemented !!! twoWayFiles::getData!!!\n" << abort(FatalError);}; 00104 00105 void giveData 00106 ( 00107 word name, 00108 word type, 00109 double ** const& field, 00110 const char* datatype = "" 00111 ) const; 00112 }; 00113 00114 00115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00116 00117 } // End namespace Foam 00118 00119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00120 00121 #endif 00122 00123 // ************************************************************************* //