update domain structure to know about inlet

This commit is contained in:
James E McClure 2019-03-06 07:04:17 -05:00
parent 7789d59635
commit 252fddac79
2 changed files with 15 additions and 0 deletions

View File

@ -30,6 +30,7 @@ Domain::Domain( int nx, int ny, int nz, int rnk, int npx, int npy, int npz,
Nx(0), Ny(0), Nz(0), Nx(0), Ny(0), Nz(0),
Lx(0), Ly(0), Lz(0), Volume(0), BoundaryCondition(0), Lx(0), Ly(0), Lz(0), Volume(0), BoundaryCondition(0),
Comm(MPI_COMM_WORLD), Comm(MPI_COMM_WORLD),
inlet_layers_x(0), inlet_layers_y(0), inlet_layers_z(0),
sendCount_x(0), sendCount_y(0), sendCount_z(0), sendCount_X(0), sendCount_Y(0), sendCount_Z(0), sendCount_x(0), sendCount_y(0), sendCount_z(0), sendCount_X(0), sendCount_Y(0), sendCount_Z(0),
sendCount_xy(0), sendCount_yz(0), sendCount_xz(0), sendCount_Xy(0), sendCount_Yz(0), sendCount_xZ(0), sendCount_xy(0), sendCount_yz(0), sendCount_xz(0), sendCount_Xy(0), sendCount_Yz(0), sendCount_xZ(0),
sendCount_xY(0), sendCount_yZ(0), sendCount_Xz(0), sendCount_XY(0), sendCount_YZ(0), sendCount_XZ(0), sendCount_xY(0), sendCount_yZ(0), sendCount_Xz(0), sendCount_XY(0), sendCount_YZ(0), sendCount_XZ(0),
@ -75,6 +76,7 @@ Domain::Domain( std::shared_ptr<Database> db, MPI_Comm Communicator):
Nx(0), Ny(0), Nz(0), Nx(0), Ny(0), Nz(0),
Lx(0), Ly(0), Lz(0), Volume(0), BoundaryCondition(0), Lx(0), Ly(0), Lz(0), Volume(0), BoundaryCondition(0),
Comm(MPI_COMM_NULL), Comm(MPI_COMM_NULL),
inlet_layers_x(0), inlet_layers_y(0), inlet_layers_z(0),
sendCount_x(0), sendCount_y(0), sendCount_z(0), sendCount_X(0), sendCount_Y(0), sendCount_Z(0), sendCount_x(0), sendCount_y(0), sendCount_z(0), sendCount_X(0), sendCount_Y(0), sendCount_Z(0),
sendCount_xy(0), sendCount_yz(0), sendCount_xz(0), sendCount_Xy(0), sendCount_Yz(0), sendCount_xZ(0), sendCount_xy(0), sendCount_yz(0), sendCount_xz(0), sendCount_Xy(0), sendCount_Yz(0), sendCount_xZ(0),
sendCount_xY(0), sendCount_yZ(0), sendCount_Xz(0), sendCount_XY(0), sendCount_YZ(0), sendCount_XZ(0), sendCount_xY(0), sendCount_yZ(0), sendCount_Xz(0), sendCount_XY(0), sendCount_YZ(0), sendCount_XZ(0),
@ -117,6 +119,14 @@ void Domain::initialize( std::shared_ptr<Database> db )
auto n = d_db->getVector<int>("n"); auto n = d_db->getVector<int>("n");
auto L = d_db->getVector<double>("L"); auto L = d_db->getVector<double>("L");
//nspheres = d_db->getScalar<int>("nspheres"); //nspheres = d_db->getScalar<int>("nspheres");
if (d_db->keyExists( "InletLayers" )){
auto InletCount = d_db->getVector<int>( "InletLayers" );
inlet_layers_x = InletCount[0];
inlet_layers_y = InletCount[1];
inlet_layers_z = InletCount[2];
}
ASSERT( n.size() == 3u ); ASSERT( n.size() == 3u );
ASSERT( L.size() == 3u ); ASSERT( L.size() == 3u );
ASSERT( nproc.size() == 3u ); ASSERT( nproc.size() == 3u );
@ -133,6 +143,10 @@ void Domain::initialize( std::shared_ptr<Database> db )
int myrank; int myrank;
MPI_Comm_rank( Comm, &myrank ); MPI_Comm_rank( Comm, &myrank );
rank_info = RankInfoStruct(myrank,nproc[0],nproc[1],nproc[2]); rank_info = RankInfoStruct(myrank,nproc[0],nproc[1],nproc[2]);
// inlet layers only apply to lower part of domain
if (nproc[0] > 0) inlet_layers_x = 0;
if (nproc[1] > 0) inlet_layers_y = 0;
if (nproc[2] > 0) inlet_layers_z = 0;
// Fill remaining variables // Fill remaining variables
N = Nx*Ny*Nz; N = Nx*Ny*Nz;
Volume = nx*ny*nx*nproc[0]*nproc[1]*nproc[2]*1.0; Volume = nx*ny*nx*nproc[0]*nproc[1]*nproc[2]*1.0;

View File

@ -109,6 +109,7 @@ public: // Public variables (need to create accessors instead)
double Lx,Ly,Lz,Volume; double Lx,Ly,Lz,Volume;
int Nx,Ny,Nz,N; int Nx,Ny,Nz,N;
int inlet_layers_x, inlet_layers_y, inlet_layers_z;
RankInfoStruct rank_info; RankInfoStruct rank_info;
MPI_Comm Comm; // MPI Communicator for this domain MPI_Comm Comm; // MPI Communicator for this domain