Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

throw if lb boundaries do not fit lb algorithm #4472

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions src/core/grid_based_algorithms/lb_boundaries.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,11 @@ void ek_init_boundaries() {
/** Initialize boundary conditions for all constraints in the system. */
void lb_init_boundaries() {
if (lattice_switch == ActiveLB::GPU) {
#if defined(CUDA) && defined(LB_BOUNDARIES_GPU)
if (this_node != 0) {
return;
}
#if defined(CUDA)
#if defined(LB_BOUNDARIES_GPU)
ek_init_boundaries();
unsigned number_of_boundnodes = 0;
std::vector<int> host_boundary_node_list;
Expand Down Expand Up @@ -228,7 +229,14 @@ void lb_init_boundaries() {
host_boundary_index_list.data(),
boundary_velocity.data());

#endif /* defined (CUDA) && defined (LB_BOUNDARIES_GPU) */
#else // defined (LB_BOUNDARIES_GPU)
if (not lbboundaries.empty()) {
runtimeErrorMsg()
<< "LB boundaries not empty for GPU LB but LB_BOUNDARIES_GPU not "
"compiled in. Activate in myconfig.hpp.";
}
#endif // defined (LB_BOUNDARIES_GPU)
#endif // defined (CUDA)
} else if (lattice_switch == ActiveLB::CPU) {
#if defined(LB_BOUNDARIES)
boost::for_each(lbfields, [](auto &f) { f.boundary = 0; });
Expand Down Expand Up @@ -260,7 +268,13 @@ void lb_init_boundaries() {
}
}
}
#endif
#else // defined(LB_BOUNDARIES)
if (not lbboundaries.empty()) {
runtimeErrorMsg()
<< "LB boundaries not empty for CPU LB but LB_BOUNDARIES not "
"compiled in. Activate in myconfig.hpp.";
}
#endif // defined(LB_BOUNDARIES)
}
}

Expand Down