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

Conversation

christophlohrmann
Copy link
Contributor

Fixes #4467

Test this by setting up a myconfig.hpp with LB_BOUNDARIES xor LB_BOUNDARIES_GPU and running

import unittest as ut
from espressomd import System, lb, lbboundaries, shapes
import espressomd


class TestBoundaryFeatureCombo(ut.TestCase):
    system = System(box_l=3 * [10])
    system.time_step = 1
    lb_bound = lbboundaries.LBBoundary(shape=shapes.Wall(normal=[1, 0, 0], dist=3))
    lb_params = {'agrid': 1.,
                 'dens': 1.,
                 'visc': 1.,
                 'tau': system.time_step}

    def test_errors(self):
        if espressomd.has_features(["CUDA", "LB_BOUNDARIES"]) and espressomd.missing_features(["LB_BOUNDARIES_GPU"]):
            lbf = lb.LBFluidGPU(**self.lb_params)
            self.system.actors.add(lbf)
            with self.assertRaises(Exception):
                self.system.lbboundaries.add(self.lb_bound)
        if espressomd.has_features(["LB_BOUNDARIES_GPU"]) and espressomd.missing_features(["LB_BOUNDARIES"]):
            lbf = lb.LBFluid(**self.lb_params)
            self.system.actors.add(lbf)
            with self.assertRaises(Exception):
                self.system.lbboundaries.add(self.lb_bound)

if __name__ == '__main__':
    ut.main()

Copy link
Member

@jngrad jngrad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jngrad jngrad added this to the Espresso 4.2 milestone Mar 14, 2022
@jngrad jngrad added Core BugFix automerge Merge with kodiak labels Mar 14, 2022
@kodiakhq kodiakhq bot merged commit 0ad16f4 into espressomd:python Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LB Boundaries on the GPU are ignored under certain conditions
2 participants