From e2a7cca884322e275b7577ce7a7818d99864c129 Mon Sep 17 00:00:00 2001 From: JamesEMcclure Date: Wed, 1 May 2019 16:37:17 -0400 Subject: [PATCH] fix domain voxel length bug --- common/Domain.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/common/Domain.cpp b/common/Domain.cpp index 723d8212..24c0c396 100644 --- a/common/Domain.cpp +++ b/common/Domain.cpp @@ -131,7 +131,11 @@ void Domain::initialize( std::shared_ptr db ) outlet_layers_y = OutletCount[1]; outlet_layers_z = OutletCount[2]; } - + voxel_length = 1.0; + if (d_db->keyExists( "voxel_length" )){ + auto voxel_length = d_db->getScalar("voxel_length"); + } + ASSERT( n.size() == 3u ); ASSERT( nproc.size() == 3u ); int nx = n[0]; @@ -158,11 +162,8 @@ void Domain::initialize( std::shared_ptr db ) // Fill remaining variables N = Nx*Ny*Nz; Volume = nx*ny*nx*nproc[0]*nproc[1]*nproc[2]*1.0; - voxel_length = 1.0; - if (d_db->keyExists( "voxel_length" )){ - auto voxel_length = d_db->getScalar("voxel_length"); - if (myrank==0) printf("voxel length = %f micron \n", voxel_length); - } + + if (myrank==0) printf("voxel length = %f micron \n", voxel_length); id = new signed char[N]; memset(id,0,N);