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 twoWayMPI 00027 00028 Description 00029 two way DEM-CFD coupling via MPI 00030 00031 \*---------------------------------------------------------------------------*/ 00032 00033 #ifndef twoWayMPI_H 00034 #define twoWayMPI_H 00035 00036 #include "dataExchangeModel.H" 00037 #include "OFstream.H" 00038 #include "sys/stat.h" 00039 00040 //=================================// 00041 //LAMMPS/LIGGGHTS 00042 #include <stdio.h> 00043 #include <stdlib.h> 00044 #include <string.h> 00045 #include <mpi.h> 00046 #include <lammps.h> // these are LAMMPS include files 00047 #include <input.h> 00048 #include <atom.h> 00049 #include <library.h> 00050 #include <error.h> 00051 #include <library_cfd_coupling.h> 00052 //=================================// 00053 00054 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00055 00056 namespace Foam 00057 { 00058 00059 /*---------------------------------------------------------------------------*\ 00060 Class noDrag Declaration 00061 \*---------------------------------------------------------------------------*/ 00062 00063 class twoWayMPI 00064 : 00065 public dataExchangeModel 00066 { 00067 private: 00068 00069 // private data 00070 dictionary propsDict_; 00071 00072 // variables 00073 int me; 00074 00075 int nprocs; 00076 00077 int liggghts; 00078 00079 MPI_Comm comm_liggghts; 00080 00081 LAMMPS_NS::LAMMPS *lmp; 00082 00083 // private member functions 00084 00085 char* wordToChar(word&) const; 00086 00087 public: 00088 00089 //- Runtime type information 00090 TypeName("twoWayMPI"); 00091 00092 00093 // Constructors 00094 00095 //- Construct from components 00096 twoWayMPI 00097 ( 00098 const dictionary& dict, 00099 cfdemCloud& sm 00100 ); 00101 00102 // Destructor 00103 00104 ~twoWayMPI(); 00105 00106 00107 // Member Functions 00108 void getScalarData 00109 ( 00110 word name, 00111 double ** const& field 00112 ) const; 00113 00114 void getVectorData 00115 ( 00116 word name, 00117 double ** const& field 00118 ) const; 00119 00120 void giveScalarData 00121 ( 00122 word name, 00123 double ** const& field 00124 ) const; 00125 00126 void giveVectorData 00127 ( 00128 word name, 00129 double ** const& field 00130 ) const; 00131 00132 void allocateArray(double**&, double, int, int=-1) const; 00133 00134 bool couple() const; 00135 00136 }; 00137 00138 00139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00140 00141 } // End namespace Foam 00142 00143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00144 00145 #endif 00146 00147 // ************************************************************************* //