00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef twoWayMPI_H
00034 #define twoWayMPI_H
00035
00036 #include "dataExchangeModel.H"
00037 #include "liggghtsCommandModel.H"
00038 #include "OFstream.H"
00039 #include "sys/stat.h"
00040
00041
00042
00043 #include <stdio.h>
00044 #include <stdlib.h>
00045 #include <string.h>
00046 #include <mpi.h>
00047 #include <lammps.h>
00048 #include <input.h>
00049 #include <atom.h>
00050 #include <library.h>
00051 #include <error.h>
00052 #include <library_cfd_coupling.h>
00053 #include <update.h>
00054
00055
00056
00057
00058 namespace Foam
00059 {
00060
00061
00062
00063
00064
00065 class twoWayMPI
00066 :
00067 public dataExchangeModel
00068 {
00069 private:
00070
00071
00072 dictionary propsDict_;
00073
00074
00075 int me;
00076
00077 int nprocs;
00078
00079 int liggghts;
00080
00081 MPI_Comm comm_liggghts;
00082
00083 LAMMPS_NS::LAMMPS *lmp;
00084
00085
00086
00087 char* wordToChar(word&) const;
00088
00089 public:
00090
00091
00092 TypeName("twoWayMPI");
00093
00094
00095
00096
00097
00098 twoWayMPI
00099 (
00100 const dictionary& dict,
00101 cfdemCloud& sm
00102 );
00103
00104
00105
00106 ~twoWayMPI();
00107
00108
00109
00110 void getData
00111 (
00112 word name,
00113 word type,
00114 double ** const& field,
00115 label step
00116 ) const;
00117
00118 void getData
00119 (
00120 word name,
00121 word type,
00122 int ** const& field,
00123 label step
00124 ) const;
00125
00126 void giveData
00127 (
00128 word name,
00129 word type,
00130 double ** const& field,
00131 const char* datatype
00132 ) const;
00133
00134
00135
00136 void allocateArray(double**&, double, int, int) const;
00137
00138 void allocateArray(double**&, double, int,const char* ="nparticles") const;
00139
00140
00141
00142 void allocateArray(int**&, int, int, int) const;
00143
00144 void allocateArray(int**&, int, int,const char* ="nparticles") const;
00145
00146
00147 bool couple() const;
00148
00149 int getNumberOfClumps() const;
00150 };
00151
00152
00153
00154
00155 }
00156
00157
00158
00159 #endif
00160
00161