Skip to content

Agglomeration example#233

Merged
bangerth merged 19 commits into
dealii:masterfrom
fdrmrc:agglomeration_poisson
Mar 31, 2026
Merged

Agglomeration example#233
bangerth merged 19 commits into
dealii:masterfrom
fdrmrc:agglomeration_poisson

Conversation

@fdrmrc

@fdrmrc fdrmrc commented Nov 24, 2025

Copy link
Copy Markdown
Contributor

This PR presents a DG solver for the Poisson problem on general polytopal meshes generated through mesh agglomeration. Starting from a fine mesh, we construct a coarser agglomerated mesh on which the DG discretization is performed.

This set of files have been extracted from the Polydeal library, a deal.II-based framework for working with agglomerated grids.

While the overall structure of poisson.cc largely follows that of a standard Poisson solver in deal.II, differences related to the usage of agglomerated meshes still need to be commented, so the PR remains a draft for now.

Comment thread agglomeration_poisson/CMakeLists.txt Outdated

CMAKE_MINIMUM_REQUIRED(VERSION 3.13.4)

FIND_PACKAGE(deal.II 9.7.0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you for your contribution!

Can you lower the requirement to deal.II 9.5.0? We at some point established that code gallery programs should compile with 9.5.0 and younger.

If your code does not compile with the older versions, you can work around it like in 42e8901.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@marcfehling Do we need this requirement? Could we allow programs to just require newer versions (or in fact change all programs to just build for, say, 9.6)?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could we allow programs to just require newer versions?

Sure, we can drop the requirement for deal.II 9.5. We didn't bump the version since summer 2023 #155.

Yet, this program still needs to compile with deal.II 9.6.

@pcafrica pcafrica force-pushed the agglomeration_poisson branch from 77cb7d2 to 0f481de Compare November 29, 2025 15:58
@pcafrica pcafrica force-pushed the agglomeration_poisson branch from f3dbd02 to 0e25728 Compare December 5, 2025 09:57

@bangerth bangerth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you, @fdrmrc and collaborators, and my apologies for letting this sit for so long. The code gallery is supposed to be a place where we don't impose exacting standards, and we should be merging programs quicker!

@bangerth

Copy link
Copy Markdown
Member

@fdrmrc You marked this program as a work in progress. Does this still apply, or is it ready to merge?

@fdrmrc fdrmrc marked this pull request as ready for review March 28, 2026 09:50
@fdrmrc

fdrmrc commented Mar 28, 2026

Copy link
Copy Markdown
Contributor Author

@bangerth Yes, this should be ready to go now. The latest commits by @xinpinggui have added extensive documentation.

@bangerth bangerth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice program! I did not look through everything, but I think it's a cool example of what one can do!

I really have only one comment, namely whether we could perhaps take the coverage stuff out of the cmake file? It is specific to GCC and/or clang, and will not work for the Windows compiler. I would like to see whether we can keep these programs available for all platforms. If you agree, either remove these lines or tell me and I can do it myself!

Comment thread agglomeration_poisson/CMakeLists.txt Outdated
Comment thread agglomeration_poisson/CMakeLists.txt Outdated
-fprofile-update=atomic
-ftest-coverage
)
target_link_options(${TARGET} PRIVATE "--coverage")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same here. I wonder whether there is a generic way to create coverage through CMake? I looked at https://danielsieger.com/blog/2024/08/03/code-coverage-with-cmake.html and that doesn't suggest anything that's not compiler-specific. I think for the purposes of a code gallery program, perhaps just remove all of the coverage stuff altogether.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure, so done!

@bangerth bangerth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's do it then!

@bangerth bangerth merged commit 123da1e into dealii:master Mar 31, 2026
@bangerth

Copy link
Copy Markdown
Member

The program is now here: https://dealii.org/developer/doxygen/deal.II/code_gallery_agglomeration_poisson.html Most of it looks good, but the images are not shown inlined into the readme text. Let me know if you'd like me to look into it, or if you see right away what the issue is.

@xinpinggui

Copy link
Copy Markdown
Contributor

Sorry for the late reply, and thank you for pointing this out.

I have now looked into the issue. The inline images were written using HTML tags such as

<img src="./doc/images/input_mesh.png" width="280">

which render well on GitHub, but do not seem to be displayed properly on the deal.II code gallery page. I have replaced them with standard Markdown image syntax, for example

![image](./doc/images/input_mesh.png).

I also noticed a few related formatting issues in the code gallery entry, including the rendering of some comments in agglomeration_poisson.cc and the layout of the references section. I will now open a follow-up pull request to fix these documentation and formatting issues.

@xinpinggui

Copy link
Copy Markdown
Contributor

Thanks again for pointing this out. I have now opened the follow-up pull request to address these image display and related formatting issues: PR #244.

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.

5 participants