Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions src/script_interface/walberla/EKContainer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ class EKContainer : public ObjectList<EKSpecies, EK::Container> {
throw std::runtime_error(
"Cannot mix single and double precision kernels");
}
auto const tau_container = m_ek_container->get_tau();
auto const tau_species = get_value<double>(obj_ptr->get_parameter("tau"));
if (tau_species != tau_container) {
throw std::runtime_error(
"EK species and EK container must have the same tau");
}
ek_throw_if_expired(obj_ptr->get_mpi_cart_comm_observer());
m_ek_container->add(obj_ptr->get_ekinstance());
});
Expand Down
4 changes: 4 additions & 0 deletions testsuite/python/ek_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,10 @@ def test_ek_container_exceptions(self):
self.system.ekcontainer.solver,
ek_solver_incompatible)
self.assertEqual(len(self.system.ekcontainer), 1)
# the tau value must match for units conversion
with self.assertRaisesRegex(RuntimeError, "EK species and EK container must have the same tau"):
self.system.ekcontainer.add(self.make_default_ek_species(tau=200.))
self.assertEqual(len(self.system.ekcontainer), 1)

def test_ek_solver_exceptions(self):
ek_solver = self.system.ekcontainer.solver
Expand Down
Loading