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

WIP change lb density to delta_density in the generated kernels #4775

Open
wants to merge 1 commit into
base: python
Choose a base branch
from

Conversation

itischler
Copy link
Contributor

Description of changes:

  • change to a zero centered lb kernel to hopefully increase precision

@espresso-ci
Copy link

Your pull request does not meet our code formatting rules. Specifically, I suggest you make the following changes:

diff --git a/maintainer/walberla_kernels/generate_lb_kernels.py b/maintainer/walberla_kernels/generate_lb_kernels.py
index 000cd7be9..af49cded5 100644
--- a/maintainer/walberla_kernels/generate_lb_kernels.py
+++ b/maintainer/walberla_kernels/generate_lb_kernels.py
@@ -52,7 +52,7 @@ else:
     target = ps.Target.CPU
 
 # Make sure we have the correct versions of the required dependencies
-#for module, requirement in [(ps, "==1.2"), (lbmpy, "==1.2")]:
+# for module, requirement in [(ps, "==1.2"), (lbmpy, "==1.2")]:
 #    assert pkg_resources.packaging.specifiers.SpecifierSet(requirement).contains(module.__version__), \
 #        f"{module.__name__} version {module.__version__} doesn't match requirement {requirement}"
 
diff --git a/src/walberla_bridge/tests/kernels_unit_tests.cpp b/src/walberla_bridge/tests/kernels_unit_tests.cpp
index c9143da79..f0289b37b 100644
--- a/src/walberla_bridge/tests/kernels_unit_tests.cpp
+++ b/src/walberla_bridge/tests/kernels_unit_tests.cpp
@@ -172,7 +172,8 @@ BOOST_AUTO_TEST_CASE(macroscopic_accessor_equilibrium_distribution) {
     }
   }
   {
-    auto const ref_d = delta_rho_d * 1. / 36. + rho_d * (5. / 12. * x * x + 2. / 12. * x);
+    auto const ref_d =
+        delta_rho_d * 1. / 36. + rho_d * (5. / 12. * x * x + 2. / 12. * x);
     auto const ref_f = static_cast<float>(ref_d);
     for (auto const direction : {Direction::NE, Direction::TN, Direction::TE}) {
       auto const pop_f = EquilibriumDistribution::get(direction, u_f, rho_f);
@@ -182,7 +183,8 @@ BOOST_AUTO_TEST_CASE(macroscopic_accessor_equilibrium_distribution) {
     }
   }
   {
-    auto const ref_d = delta_rho_d * 1. / 36. + rho_d * (5. / 12. * x * x - 2. / 12. * x);
+    auto const ref_d =
+        delta_rho_d * 1. / 36. + rho_d * (5. / 12. * x * x - 2. / 12. * x);
     auto const ref_f = static_cast<float>(ref_d);
     for (auto const direction : {Direction::SW, Direction::BS, Direction::BW}) {
       auto const pop_f = EquilibriumDistribution::get(direction, u_f, rho_f);

To apply these changes, please do one of the following:

  • You can download a patch with my suggested changes here, inspect it and make changes manually.
  • You can directly apply it to your repository by running curl https://gitlab.icp.uni-stuttgart.de/espressomd/espresso/-/jobs/350493/artifacts/raw/style.patch | git apply -.
  • You can run maintainer/CI/fix_style.sh to automatically fix your coding style. This is the same command that I have executed to generate the patch above, but it requires certain tools to be installed on your computer.

You can run gitlab-runner exec docker style afterwards to check if your changes worked out properly.

Please note that there are often multiple ways to correctly format code. As I am just a robot, I sometimes fail to identify the most aesthetically pleasing way. So please look over my suggested changes and adapt them where the style does not make sense.

@espresso-ci
Copy link

Your pull request does not meet our code style rules. Pylint summary:

************* Module generate_lb_kernels
maintainer/walberla_kernels/generate_lb_kernels.py:21:0: W0611: Unused import pkg_resources (unused-import)
************* Module walberla_lbm_generation
maintainer/walberla_kernels/walberla_lbm_generation.py:150:4: W0612: Unused variable 'delta_rho_sym' (unused-variable)

You can generate these warnings with maintainer/CI/fix_style.sh. This is the same command that I have executed to generate the log above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants