Skip to content

Commit

Permalink
Remove performance regression in LB particle coupling (#4757)
Browse files Browse the repository at this point in the history
Fixes #4752

Description of changes:
- skip expensive runtime checks on type-erased waLBerla fields during particle coupling
  • Loading branch information
kodiakhq[bot] authored Jul 19, 2023
2 parents 6a56470 + 39a5824 commit 95d47b9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/walberla_bridge/src/lattice_boltzmann/LBWalberlaImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,8 @@ class LBWalberlaImpl : public LBWalberlaBase {
if (!bc)
return {};

auto field = bc->block->template getData<VectorField>(m_velocity_field_id);
auto field = bc->block->template uncheckedFastGetData<VectorField>(
m_velocity_field_id);
auto const vec = lbm::accessor::Vector::get(field, bc->cell);
return to_vector3d(vec);
}
Expand Down Expand Up @@ -915,7 +916,8 @@ class LBWalberlaImpl : public LBWalberlaBase {
if (!bc)
return {boost::none};

auto pdf_field = bc->block->template getData<PdfField>(m_pdf_field_id);
auto pdf_field =
bc->block->template uncheckedFastGetData<PdfField>(m_pdf_field_id);
auto const density = lbm::accessor::Density::get(pdf_field, bc->cell);
return {double_c(density)};
}
Expand Down

0 comments on commit 95d47b9

Please sign in to comment.