From 57156d16fca13963fa85ed4167911bdca6465b86 Mon Sep 17 00:00:00 2001 From: Mark Berrill Date: Wed, 5 Feb 2020 07:35:13 -0500 Subject: [PATCH 1/2] Fixing build issue --- cmake/libraries.cmake | 1 + common/MPI.cpp | 2 +- gpu/Color.cu | 6 +----- gpu/D3Q19.cu | 1 - 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/cmake/libraries.cmake b/cmake/libraries.cmake index dca31ea9..43d2726e 100644 --- a/cmake/libraries.cmake +++ b/cmake/libraries.cmake @@ -308,5 +308,6 @@ MACRO ( CONFIGURE_LBPM ) # Suppress some common warnings IF ( USING_GCC ) SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-reorder -Wno-unused-parameter") + SET( CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --compiler-options -Wno-reorder,-Wno-unused-parameter") ENDIF() ENDMACRO () diff --git a/common/MPI.cpp b/common/MPI.cpp index 9495372d..8b09bc49 100644 --- a/common/MPI.cpp +++ b/common/MPI.cpp @@ -35,7 +35,7 @@ // Using MAC #define USE_MAC #include -#elif defined( __linux ) || defined( __unix ) || defined( __posix ) +#elif defined( __linux ) || defined( __linux__ ) || defined( __unix ) || defined( __posix ) // We are using linux #define USE_LINUX #include diff --git a/gpu/Color.cu b/gpu/Color.cu index 347858b9..30c16b51 100644 --- a/gpu/Color.cu +++ b/gpu/Color.cu @@ -128,7 +128,7 @@ __global__ void dvc_ScaLBL_Color_InitDistance(char *ID, double *Den, double *Ph __global__ void dvc_ScaLBL_Color_BC(int *list, int *Map, double *Phi, double *Den, double vA, double vB, int count, int Np) { - int idx,n,nm; + int idx,n; // Fill the outlet with component b idx = blockIdx.x*blockDim.x + threadIdx.x; if (idx < count){ @@ -3471,13 +3471,11 @@ __global__ void dvc_ScaLBL_D3Q19_AAeven_ColorMass(double *Aq, double *Bq, double double *Velocity, double *ColorGrad, double beta, int start, int finish, int Np){ int n; - double fq; // non-conserved moments double nA,nB; // number density double a1,b1,a2,b2,nAB,delta; double C,nx,ny,nz; //color gradient magnitude and direction double ux,uy,uz; - double phi,tau,rho0,rlx_setA,rlx_setB; int S = Np/NBLOCKS/NTHREADS + 1; for (int s=0; s Date: Wed, 12 Feb 2020 14:19:16 -0500 Subject: [PATCH 2/2] support for grid file in MRT model --- models/MRTModel.cpp | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/models/MRTModel.cpp b/models/MRTModel.cpp index 2ddba403..60847e54 100644 --- a/models/MRTModel.cpp +++ b/models/MRTModel.cpp @@ -3,6 +3,7 @@ */ #include "models/MRTModel.h" #include "analysis/distance.h" +#include "common/ReadMicroCT.h" ScaLBL_MRTModel::ScaLBL_MRTModel(int RANK, int NP, const Utilities::MPI& COMM): rank(RANK), nprocs(NP), Restart(0),timestep(0),timestepMax(0),tau(0), @@ -98,15 +99,29 @@ void ScaLBL_MRTModel::ReadInput(){ sprintf(LocalRankFilename,"%s%s","ID.",LocalRankString); sprintf(LocalRestartFile,"%s%s","Restart.",LocalRankString); - if (domain_db->keyExists( "Filename" )){ - auto Filename = domain_db->getScalar( "Filename" ); - Mask->Decomp(Filename); - } - else{ - Mask->ReadIDs(); - } + + if (domain_db->keyExists( "Filename" )){ + auto Filename = domain_db->getScalar( "Filename" ); + Mask->Decomp(Filename); + } + else if (domain_db->keyExists( "GridFile" )){ + // Read the local domain data + auto input_id = readMicroCT( *domain_db, comm ); + // Fill the halo (assuming GCW of 1) + array size0 = { (int) input_id.size(0), (int) input_id.size(1), (int) input_id.size(2) }; + ArraySize size1 = { (size_t) Mask->Nx, (size_t) Mask->Ny, (size_t) Mask->Nz }; + ASSERT( (int) size1[0] == size0[0]+2 && (int) size1[1] == size0[1]+2 && (int) size1[2] == size0[2]+2 ); + fillHalo fill( comm, Mask->rank_info, size0, { 1, 1, 1 }, 0, 1 ); + Array id_view; + id_view.viewRaw( size1, Mask->id ); + fill.copy( input_id, id_view ); + fill.fill( id_view ); + } + else{ + Mask->ReadIDs(); + } - // Generate the signed distance map + // Generate the signed distance map // Initialize the domain and communication Array id_solid(Nx,Ny,Nz); // Solve for the position of the solid phase