Skip to content
Snippets Groups Projects
Commit 7b0e99b1 authored by Cameron Stewart's avatar Cameron Stewart
Browse files

remove superfluous communication and fix some conversion warnings

parent ac046fab
No related merge requests found
...@@ -46,7 +46,7 @@ public: ...@@ -46,7 +46,7 @@ public:
Su( Blocks_T blocks, BlockDataID force, BlockDataID pdfId, BlockDataID boundaryHandlingId, BlockDataID stressId, BlockDataID stressOldId, real_t lambda_p, real_t eta_p, Su( Blocks_T blocks, BlockDataID force, BlockDataID pdfId, BlockDataID boundaryHandlingId, BlockDataID stressId, BlockDataID stressOldId, real_t lambda_p, real_t eta_p,
uint_t period = uint_c(1), bool compressibleFlag = false): blocks_( blocks ), forceId_( force ), pdfId_(pdfId), boundaryHandlingId_(boundaryHandlingId), stressId_(stressId), stressOldId_(stressOldId), uint_t period = uint_c(1), bool compressibleFlag = false): blocks_( blocks ), forceId_( force ), pdfId_(pdfId), boundaryHandlingId_(boundaryHandlingId), stressId_(stressId), stressOldId_(stressOldId),
inv_lambda_p_( real_c(1.0)/lambda_p ), eta_p_( eta_p ), delta_t_( real_c(period) ), executionCount_( 0 ), communicateStress_(blocks), communicateStressOld_(blocks), inv_lambda_p_( real_c(1.0)/lambda_p ), eta_p_( eta_p ), delta_t_( real_c(period) ), executionCount_( 0 ), communicateStress_(blocks),
communicateVelocities_(blocks), compressibleFlag_(compressibleFlag) communicateVelocities_(blocks), compressibleFlag_(compressibleFlag)
{ {
// create velocity fields // create velocity fields
...@@ -54,7 +54,6 @@ public: ...@@ -54,7 +54,6 @@ public:
// stress and velocity communication scheme // stress and velocity communication scheme
communicateStress_.addPackInfo( make_shared< field::communication::PackInfo<StressField_T> >( stressId_ )); communicateStress_.addPackInfo( make_shared< field::communication::PackInfo<StressField_T> >( stressId_ ));
communicateStressOld_.addPackInfo( make_shared< field::communication::PackInfo<StressField_T> >( stressOldId_ ));
communicateVelocities_.addPackInfo( make_shared< field::communication::PackInfo<VelocityField_T> >( velocityId_ )); communicateVelocities_.addPackInfo( make_shared< field::communication::PackInfo<VelocityField_T> >( velocityId_ ));
WALBERLA_ASSERT_GREATER_EQUAL(delta_t_, real_c(1.0)); WALBERLA_ASSERT_GREATER_EQUAL(delta_t_, real_c(1.0));
...@@ -62,12 +61,11 @@ public: ...@@ -62,12 +61,11 @@ public:
Su( Blocks_T blocks, BlockDataID force, BlockDataID pdfId, BlockDataID boundaryHandlingId, BlockDataID stressId, BlockDataID stressOldId, BlockDataID velocityId, real_t lambda_p, real_t eta_p, Su( Blocks_T blocks, BlockDataID force, BlockDataID pdfId, BlockDataID boundaryHandlingId, BlockDataID stressId, BlockDataID stressOldId, BlockDataID velocityId, real_t lambda_p, real_t eta_p,
uint_t period = uint_c(1), bool compressibleFlag = false): blocks_( blocks ), forceId_( force ), pdfId_(pdfId), boundaryHandlingId_(boundaryHandlingId), stressId_(stressId), stressOldId_(stressOldId), uint_t period = uint_c(1), bool compressibleFlag = false): blocks_( blocks ), forceId_( force ), pdfId_(pdfId), boundaryHandlingId_(boundaryHandlingId), stressId_(stressId), stressOldId_(stressOldId),
velocityId_(velocityId), inv_lambda_p_( real_c(1.0)/lambda_p ), eta_p_( eta_p ), delta_t_( real_c(period) ), executionCount_( 0 ), communicateStress_(blocks), communicateStressOld_(blocks), velocityId_(velocityId), inv_lambda_p_( real_c(1.0)/lambda_p ), eta_p_( eta_p ), delta_t_( real_c(period) ), executionCount_( 0 ), communicateStress_(blocks),
communicateVelocities_(blocks), compressibleFlag_(compressibleFlag) communicateVelocities_(blocks), compressibleFlag_(compressibleFlag)
{ {
// stress and velocity communication scheme // stress and velocity communication scheme
communicateStress_.addPackInfo( make_shared< field::communication::PackInfo<StressField_T> >( stressId_ )); communicateStress_.addPackInfo( make_shared< field::communication::PackInfo<StressField_T> >( stressId_ ));
communicateStressOld_.addPackInfo( make_shared< field::communication::PackInfo<StressField_T> >( stressOldId_ ));
communicateVelocities_.addPackInfo( make_shared< field::communication::PackInfo<VelocityField_T> >( velocityId_ )); communicateVelocities_.addPackInfo( make_shared< field::communication::PackInfo<VelocityField_T> >( velocityId_ ));
WALBERLA_ASSERT_GREATER_EQUAL(delta_t_, real_c(1.0)); WALBERLA_ASSERT_GREATER_EQUAL(delta_t_, real_c(1.0));
...@@ -245,7 +243,6 @@ public: ...@@ -245,7 +243,6 @@ public:
} }
} }
communicateVelocities_(); communicateVelocities_();
communicateStressOld_();
for( auto it = blocks_->begin(); it != blocks_->end(); ++it ){ for( auto it = blocks_->begin(); it != blocks_->end(); ++it ){
auto block = it.get(); auto block = it.get();
if (executionCount_ % uint_c(delta_t_) == 0) if (executionCount_ % uint_c(delta_t_) == 0)
...@@ -265,7 +262,7 @@ private: ...@@ -265,7 +262,7 @@ private:
BlockDataID forceId_, pdfId_, boundaryHandlingId_, stressId_, stressOldId_, velocityId_; BlockDataID forceId_, pdfId_, boundaryHandlingId_, stressId_, stressOldId_, velocityId_;
const real_t inv_lambda_p_, eta_p_, delta_t_; const real_t inv_lambda_p_, eta_p_, delta_t_;
uint_t executionCount_; uint_t executionCount_;
blockforest::communication::UniformBufferedScheme< typename LatticeModel_T::CommunicationStencil > communicateStress_, communicateStressOld_, communicateVelocities_; blockforest::communication::UniformBufferedScheme< typename LatticeModel_T::CommunicationStencil > communicateStress_, communicateVelocities_;
bool compressibleFlag_; bool compressibleFlag_;
}; };
......
...@@ -179,7 +179,7 @@ public: ...@@ -179,7 +179,7 @@ public:
for (auto blockIt = blocks_->begin(); blockIt != blocks_->end(); ++blockIt) { for (auto blockIt = blocks_->begin(); blockIt != blocks_->end(); ++blockIt) {
PdfField_T *pdf = blockIt.get()->getData<PdfField_T>(pdfFieldId_); PdfField_T *pdf = blockIt.get()->getData<PdfField_T>(pdfFieldId_);
if (blockIt.get()->getAABB().contains(L_/2.0, H_/2.0, 0)) { if (blockIt.get()->getAABB().contains(float_c(L_/2.0), float_c(H_/2.0), 0)) {
uCurr_ = pdf->getVelocity(int32_c(blockSize_/2), int32_c(blockSize_/2), 0)[0]/uExpected_; uCurr_ = pdf->getVelocity(int32_c(blockSize_/2), int32_c(blockSize_/2), 0)[0]/uExpected_;
tCurr_ = timeloop_.getCurrentTimeStep(); tCurr_ = timeloop_.getCurrentTimeStep();
if (tCurr_ == timesteps_ - 1){ if (tCurr_ == timesteps_ - 1){
...@@ -254,7 +254,7 @@ int main(int argc, char ** argv ){ ...@@ -254,7 +254,7 @@ int main(int argc, char ** argv ){
const uint_t timesteps = parameters.getParameter< uint_t > ("timesteps"); const uint_t timesteps = parameters.getParameter< uint_t > ("timesteps");
// reference data // reference data
const real_t uExpected = force*H*H/(8.0*(eta_s + eta_p)); const real_t uExpected = force*H*H/(real_c(8.0)*(eta_s + eta_p));
const real_t uMax = parameters.getParameter< real_t > ("uMax"); const real_t uMax = parameters.getParameter< real_t > ("uMax");
const real_t t0 = parameters.getParameter< real_t > ("t0"); const real_t t0 = parameters.getParameter< real_t > ("t0");
const real_t t1 = parameters.getParameter< real_t > ("t1"); const real_t t1 = parameters.getParameter< real_t > ("t1");
...@@ -293,10 +293,10 @@ int main(int argc, char ** argv ){ ...@@ -293,10 +293,10 @@ int main(int argc, char ** argv ){
// compare to reference data // compare to reference data
real_t errSteady = abs(testData->getUSteady() - 1.0)/1.0; real_t errSteady = fabs(testData->getUSteady() - real_c(1.0))/real_c(1.0);
real_t errMax = abs(testData->getUMax() - uMax)/uMax; real_t errMax = fabs(testData->getUMax() - uMax)/uMax;
real_t errt0 = abs(testData->getT0() - t0)/t0; real_t errt0 = fabs(testData->getT0() - t0)/t0;
real_t errt1 = abs(testData->getT1() - t1)/t1; real_t errt1 = fabs(testData->getT1() - t1)/t1;
WALBERLA_LOG_RESULT("Steady State Velocity Error: " << errSteady ); WALBERLA_LOG_RESULT("Steady State Velocity Error: " << errSteady );
WALBERLA_LOG_RESULT("Maximum Velocity Error: " << errMax ); WALBERLA_LOG_RESULT("Maximum Velocity Error: " << errMax );
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment